X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;f=src%2Fcontrol.h;h=492ac88e3811831661774e9efb612b6951e29d1a;hb=4b5302fe73b9aa08819ff740bbf8286352a990fb;hp=599f04b3cc6f3316f295bb6a3144c77aa25858ce;hpb=fcf58a650b9c0a9c3aa08c2c25ea14d70e08f8c7;p=plomrogue diff --git a/src/control.h b/src/control.h index 599f04b..492ac88 100644 --- a/src/control.h +++ b/src/control.h @@ -1,21 +1,41 @@ /* control.h + * + * Routines for handling control input from keyboard or record file. */ #ifndef CONTROL_H #define CONTROL_H +#include /* for uint8_t */ -#include /* for uint8_t */ -#include "yx_uint16.h" /* for yx_uint16 coordinates */ -struct World; +/* Return keycode to action of "name" if available in current window config. */ +extern uint16_t get_available_keycode_to_action(char * name); -/* Call some meta game / window management actions dependent on key. If the - * "quit" action is called, return 1 only instead of doing anything directly. + +/* Control the player character, either via action id "action" or pressed "key". + * Return 1 on success, 0 if no appropriate action to trigger was found. + */ +extern uint8_t player_control_by_id(int action); +extern uint8_t player_control_by_key(int key); + + + +/* Control via "key" active window's geometry / keybindings in respective config + * view. + */ +extern uint8_t wingeom_control(int key); +extern uint8_t winkeyb_control(int key); + + + +/* Call by "key" further game / window management actions that don't influence + * the player character. If the "quit" action is called, return 1 (instead of + * exiting directly). */ -extern uint8_t meta_keys(int key, struct World * world); +extern uint8_t meta_control(int key);