Move keyboard binding accessor to bindings.[ch]

Rename `get_binding` to `get_keyboard_binding` and ensure that this
function only accesses bindings of type B_KEYBOARD. Other types of
bindings (e.g. mouse bindings) will be accessed by a different function.
This commit is contained in:
Tony Crisci
2014-02-21 19:10:21 -05:00
committed by Michael Stapelberg
parent 0f6c411f06
commit 3d6d0c134c
5 changed files with 71 additions and 67 deletions

View File

@ -84,7 +84,7 @@ void handle_key_press(xcb_key_press_event_t *event) {
DLOG("(checked mode_switch, state %d)\n", state_filtered);
/* Find the binding */
Binding *bind = get_binding(state_filtered, key_release, event->detail);
Binding *bind = get_keyboard_binding(state_filtered, key_release, event->detail);
/* No match? Then the user has Mode_switch enabled but does not have a
* specific keybinding. Fall back to the default keybindings (without
@ -93,7 +93,7 @@ void handle_key_press(xcb_key_press_event_t *event) {
if (bind == NULL) {
state_filtered &= ~(BIND_MODE_SWITCH);
DLOG("no match, new state_filtered = %d\n", state_filtered);
if ((bind = get_binding(state_filtered, key_release, event->detail)) == NULL) {
if ((bind = get_keyboard_binding(state_filtered, key_release, event->detail)) == NULL) {
/* This is not a real error since we can have release and
* non-release keybindings. On a KeyPress event for which there is
* only a !release-binding, but no release-binding, the