diff --git a/src/config/kbdbind.c b/src/config/kbdbind.c index db597af6..43af3094 100644 --- a/src/config/kbdbind.c +++ b/src/config/kbdbind.c @@ -584,7 +584,7 @@ bind_key_to_event(unsigned char *ckmap, const unsigned char *ckey, int event) action_id_T action_id; enum keymap_id keymap_id = get_keymap_id(ckmap); - if (keymap_id < 0) + if (keymap_id == KEYMAP_INVALID) return gettext("Unrecognised keymap"); if (parse_keystroke(ckey, &kbd) < 0) @@ -907,7 +907,7 @@ bind_do(unsigned char *keymap_str, const unsigned char *keystroke_str, struct keybinding *keybinding; keymap_id = get_keymap_id(keymap_str); - if (keymap_id < 0) return 1; + if (keymap_id == KEYMAP_INVALID) return 1; if (parse_keystroke(keystroke_str, &kbd) < 0) return 2; @@ -929,7 +929,7 @@ bind_act(unsigned char *keymap_str, const unsigned char *keystroke_str) struct keybinding *keybinding; keymap_id = get_keymap_id(keymap_str); - if (keymap_id < 0) + if (keymap_id == KEYMAP_INVALID) return NULL; keybinding = kbd_stroke_lookup(keymap_id, keystroke_str); diff --git a/src/config/kbdbind.h b/src/config/kbdbind.h index 4ef6f1a2..e046fd8b 100644 --- a/src/config/kbdbind.h +++ b/src/config/kbdbind.h @@ -14,6 +14,7 @@ struct module; typedef long action_id_T; enum keymap_id { + KEYMAP_INVALID = -1, KEYMAP_MAIN, KEYMAP_EDIT, KEYMAP_MENU,