home · contact · privacy
Strongly overhauled keybinding managemment. Window-specific keybindings and a window...
[plomrogue] / src / control.h
1 /* control.h
2  *
3  * Routines for handling control input from keyboard or record file.
4  */
5
6 #ifndef CONTROL_H
7 #define CONTROL_H
8
9
10
11 #include <stdint.h> /* for uint8_t */
12 struct World;
13
14
15
16 /* Return keycode to action of "name" if available in current window config. */
17 extern uint16_t get_available_keycode_to_action(struct World * world,
18                                                 char * name);
19
20
21
22 /* Control the player character, either via recorded "action" or pressed "key".
23  */
24 extern void record_control(int action, struct World * world);
25 extern uint8_t player_control(int key, struct World * world);
26
27
28
29 /* Control via "key" active window's geometry / keybindings in respective config
30  * view.
31  */
32 extern uint8_t wingeom_control(int key, struct World * world);
33 extern uint8_t winkeyb_control(int key, struct World * world);
34
35
36
37 /* Call by "key" further game / window management actions that don't influence
38  * the player character. If the "quit" action is called, return 1 (instead of
39  * exiting directly).
40  */
41 extern uint8_t meta_control(int key, struct World * world);
42
43
44
45 #endif