X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=src%2Fclient%2Fcontrol.h;h=6cc251a724136dab72ded78e7507968978741913;hb=891ba8fbca53d920f6b3704827fa6b8aee737de4;hp=56d33c30bdf23325fc379af8fdfd9608d77baaa8;hpb=c53b1488c5a53e8b12cb3a631763f98010420690;p=plomrogue diff --git a/src/client/control.h b/src/client/control.h index 56d33c3..6cc251a 100644 --- a/src/client/control.h +++ b/src/client/control.h @@ -6,30 +6,15 @@ #ifndef CONTROL_H #define CONTROL_H -#include /* uint8_t */ +#include /* uint8_t, uint16_t */ -/* Tries to call by "key" for player actions triggering messages to the server. - * The appropriate Command struct's .server_msg will be sent, followed by a " ", - * followed by either a string representation of the numerical value of the - * Command struct's .arg, or, if .arg == 'i', world.player_inventory_select. - * Returns 1 on success, 0 on failure. +/* Try to match "key" to the Command DB and execute appropriate actions if + * successful. Return 0 on failure, 2 for calling a "quit" comand (to be + * handled externally) and 1 for calling any other command. */ -extern uint8_t player_control(int key); - -/* Try to call by "key" actions for active window's keybindings/geometry config - * view. Return 1 on success, 0 on failure. - */ -extern uint8_t wingeom_control(int key); -extern uint8_t winkeyb_control(int key); - -/* Try to call by "key" basic window and game management actions that do not - * send a message to the server and do not change individual windows' - * keybindings or geometries. Returns 0 on failure, 2 for calling a "quit" - * action (to be handled externally) and 1 for calling any other action. - */ -extern uint8_t meta_control(int key); +extern uint8_t try_key(uint16_t key);