Base: LCDproc 0.5.2
[lcdproc-de200c.git] / server / input.h
blobc42f85bb5da52d97155f9503b9b15720dacf92dd
1 /*
2 * input.h
3 * This file is part of LCDd, the lcdproc server.
5 * This file is released under the GNU General Public License. Refer to the
6 * COPYING file distributed with this package.
8 * Copyright (c) 1999, William Ferrell, Scott Scriven
9 * 2003, Joris Robijn
13 #ifndef INPUT_H
14 #define INPUT_H
16 #include <stdlib.h>
18 /* Accepts and uses keypad input while displaying screens... */
19 int handle_input(void);
21 #ifndef bool
22 # define bool short
23 # define true 1
24 # define false 0
25 #endif
27 typedef struct KeyReservation {
28 char *key;
29 bool exclusive;
30 Client *client; /* NULL for internal clients */
31 } KeyReservation;
34 int input_init(void);
35 /* Init the input handling system */
37 int input_shutdown(void);
38 /* Shut it down */
40 int input_reserve_key(const char *key, bool exclusive, Client *client);
41 /* Reserves a key for a client */
42 /* Return -1 if reservation of key is not possible */
44 void input_release_key(const char *key, Client *client);
45 /* Releases a key reservation */
47 void input_release_client_keys(Client *client);
48 /* Releases all key reservations for a given client */
50 KeyReservation *input_find_key(const char *key, Client *client);
51 /* Finds if a key reservation causes a 'hit'.
52 * If the key was reserved exclusively, the client will be ignored.
53 * If the key was reserved shared, the client must match.
56 #endif