X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;f=src%2Fcontrol.h;h=30b2dda06b6d49d624903879535d975d3ad64efb;hb=d701e79e9297470b56315eefd431c62c9aba28b2;hp=bd5dd0ce36a8b94743cc872fd7aefe69cfa2eca8;hpb=7b26f28c6d6028b5aad2ba93a5c8911f6118e6e9;p=plomrogue diff --git a/src/control.h b/src/control.h index bd5dd0c..30b2dda 100644 --- a/src/control.h +++ b/src/control.h @@ -1,22 +1,41 @@ /* control.h * - * Routines for handling user's key press input. + * Routines for handling control input from keyboard or record file. */ #ifndef CONTROL_H #define CONTROL_H +#include /* for uint8_t */ -#include /* for uint8_t */ -struct World; + +/* Return keycode to action of "name" if available in current window config. */ +extern uint16_t get_available_keycode_to_action(char * name); + + + +/* 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_key(int key); +extern uint8_t player_control_by_id(int action); + + + +/* 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 some meta game / window management actions dependent on key. If the - * "quit" action is called, return 1 only instead of doing anything directly. +/* 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);