Files
lcdproc/server/input.h
T

57 lines
1.4 KiB
C
Raw Normal View History

2008-11-30 22:31:20 +00:00
/** \file server/input.h
*/
/* This file is part of LCDd, the lcdproc server.
*
2008-11-30 22:31:20 +00:00
* This file is released under the GNU General Public License.
* Refer to the COPYING file distributed with this package.
*
2011-01-05 23:34:37 +00:00
* Copyright (c) 1999, William Ferrell, Selene Scriven
* 2003, Joris Robijn
*/
1999-12-09 23:15:14 +00:00
#ifndef INPUT_H
#define INPUT_H
2012-02-22 22:25:32 +00:00
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#endif
#include "shared/defines.h"
2002-05-26 19:21:23 +00:00
2001-12-30 00:15:25 +00:00
/* Accepts and uses keypad input while displaying screens... */
2007-04-02 21:29:53 +00:00
int handle_input(void);
1999-12-09 23:15:14 +00:00
2002-05-26 19:21:23 +00:00
typedef struct KeyReservation {
2007-04-02 21:29:53 +00:00
char *key;
2002-05-26 19:21:23 +00:00
bool exclusive;
2007-04-02 21:29:53 +00:00
Client *client; /* NULL for internal clients */
2002-05-26 19:21:23 +00:00
} KeyReservation;
2007-04-02 21:29:53 +00:00
int input_init(void);
2002-05-26 19:21:23 +00:00
/* Init the input handling system */
2007-04-02 21:29:53 +00:00
int input_shutdown(void);
/* Shut it down */
2007-04-02 21:29:53 +00:00
int input_reserve_key(const char *key, bool exclusive, Client *client);
2002-05-26 19:21:23 +00:00
/* Reserves a key for a client */
/* Return -1 if reservation of key is not possible */
2007-04-02 21:29:53 +00:00
void input_release_key(const char *key, Client *client);
2002-05-26 19:21:23 +00:00
/* Releases a key reservation */
2007-04-02 21:29:53 +00:00
void input_release_client_keys(Client *client);
2002-05-26 19:21:23 +00:00
/* Releases all key reservations for a given client */
2007-04-02 21:29:53 +00:00
KeyReservation *input_find_key(const char *key, Client *client);
2002-05-26 19:21:23 +00:00
/* Finds if a key reservation causes a 'hit'.
* If the key was reserved exclusively, the client will be ignored.
* If the key was reserved shared, the client must match.
*/
2001-12-30 00:15:25 +00:00
1999-12-09 23:15:14 +00:00
#endif