home · contact · privacy
Define server messages and server message arguments in confclient/commands, instead...
[plomrogue] / src / client / control.h
1 /* src/client/control.h
2  *
3  * Routines for handling control input from the keyboard.
4  */
5
6 #ifndef CONTROL_H
7 #define CONTROL_H
8
9 #include <stdint.h> /* uint8_t */
10
11
12
13 /* Tries to call by "key" for player actions triggering messages to the server.
14  * The appropriate Command struct's .server_msg will be sent, followed by a " ",
15  * followed by either a string representation of the numerical value of the
16  * Command struct's .arg, or, if .arg == 'i', world.player_inventory_select.
17  * Returns 1 on success, 0 on failure.
18  */
19 extern uint8_t player_control(int key);
20
21 /* Try to call by "key" actions for active window's keybindings/geometry config
22  * view. Return 1 on success, 0 on failure.
23  */
24 extern uint8_t wingeom_control(int key);
25 extern uint8_t winkeyb_control(int key);
26
27 /* Try to call by "key" basic window and game management actions that do not
28  * send a message to the server and do not change individual windows'
29  * keybindings or geometries. Returns 0 on failure, 2 for calling a "quit"
30  * action (to be handled externally) and 1 for calling any other action.
31  */
32 extern uint8_t meta_control(int key);
33
34
35
36 #endif