X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;ds=sidebyside;f=src%2Fclient%2Fkeybindings.h;fp=src%2Fclient%2Fkeybindings.h;h=e288203b2ff163ce14559a370e082b4486019d78;hb=a8097b8fef09444ebac0f1e2d3ffc4e621557b28;hp=ea09d6582e5e2ab41a7d1fdedd37928d1c167277;hpb=c53b1488c5a53e8b12cb3a631763f98010420690;p=plomrogue diff --git a/src/client/keybindings.h b/src/client/keybindings.h index ea09d65..e288203 100644 --- a/src/client/keybindings.h +++ b/src/client/keybindings.h @@ -7,14 +7,15 @@ #define KEYBINDINGS_H #include /* uint8_t, uint16_t */ +struct Command; struct KeyBinding { struct KeyBinding * next; - uint16_t key; /* keycode */ - char * command; /* name of command / functionality bound to keycode */ + uint16_t key; /* keycode */ + struct Command * command; /* command in command DB to which key is bound */ }; struct KeyBindingDB @@ -26,12 +27,9 @@ struct KeyBindingDB -/* Return name of command / functionality bound to keycode; NULL on failure. */ -extern char * get_command_to_keycode(struct KeyBinding * kb_p, uint16_t key); - -/* Return keycode bound to "command". */ -extern uint16_t get_keycode_to_command(struct KeyBinding * keybindings, - char * command); +/* Return command bound to keycode; NULL on failure. */ +extern struct Command * get_command_to_keycode(struct KeyBinding * kb_p, + uint16_t key); /* Return human-readable name (of maximum 9 chars) for "keycode" as matched by * ncurses.h; if none is found, return "UNKNOWN".