Functions |
| void | keybind_load () |
| void | keybind_save () |
| void | keybind_free (keybind_struct *keybind) |
| void | keybind_deinit () |
| static SDLMod | keybind_adjust_kmod (SDLMod mod) |
| keybind_struct * | keybind_add (SDLKey key, SDLMod mod, const char *command) |
| void | keybind_edit (size_t i, SDLKey key, SDLMod mod, const char *command) |
| void | keybind_remove (size_t i) |
| void | keybind_repeat_toggle (size_t i) |
| char * | keybind_get_key_shortcut (SDLKey key, SDLMod mod, char *buf, size_t len) |
| keybind_struct * | keybind_find_by_command (const char *cmd) |
| int | keybind_command_matches_event (const char *cmd, SDL_KeyboardEvent *event) |
| int | keybind_command_matches_state (const char *cmd) |
| int | keybind_process_event (SDL_KeyboardEvent *event) |
| void | keybind_repeat () |
| void | keybind_process (keybind_struct *keybind, uint8 type) |
| int | keybind_process_command_up (const char *cmd) |
| int | keybind_process_command (const char *cmd) |
Variables |
| keybind_struct ** | keybindings = NULL |
| size_t | keybindings_num = 0 |
Handles keybindings.
Whenever a keyboard event occurs and the user is logged into the game, keybindings are checked for a match. First keybindings with modifier keys are checked to see if they match the event key and modifier state, then keybindings without modifier keys are checked and will work regardless of the current key modifier state.
This is done to ensure user commands will work correctly, even if they have modifier keys. For example, CTRL+c would not work if it was near the bottom of the keybinding list, because the 'c' keybinding near the top would work first.
Also if the keybindings with no modifier keys were not triggered regardless of the current keyboard modifier state, it would not be possible to do actions such as alt+numpad, or ctrl+numpad.
- Author:
- Alex Tokar
Definition in file keybind.c.