# HG changeset patch # User Aidan Kehoe # Date 1426291670 0 # Node ID 36934833b4f3539cd85b5343d93eaa7822cb4869 # Parent 6ec4964c168757948e11cb77e28966c253f00559 #'event-matches-key-specifier-p, check keysyms and modifiers too on TTY src/ChangeLog addition: 2015-03-14 Aidan Kehoe * keymap.c (event_matches_key_specifier_p): If on a TTY, check the keysym and modifiers too, before converting both events to characters and comparing them. We may well have seen a function key (by means of function-key-map) and it is actively unhelpful for (event-matches-key-specifier-p (character-to-event 'f1) 'f1) to given nil when the current device is a TTY. diff -r 6ec4964c1687 -r 36934833b4f3 src/ChangeLog --- a/src/ChangeLog Thu Mar 12 23:31:42 2015 +0000 +++ b/src/ChangeLog Sat Mar 14 00:07:50 2015 +0000 @@ -1,3 +1,13 @@ +2015-03-14 Aidan Kehoe + + * keymap.c (event_matches_key_specifier_p): + If on a TTY, check the keysym and modifiers too, before converting + both events to characters and comparing them. We may well have + seen a function key (by means of function-key-map) and it is + actively unhelpful for + (event-matches-key-specifier-p (character-to-event 'f1) 'f1) + to given nil when the current device is a TTY. + 2015-03-12 Aidan Kehoe * event-stream.c (lookup_command_event): diff -r 6ec4964c1687 -r 36934833b4f3 src/keymap.c --- a/src/keymap.c Thu Mar 12 23:31:42 2015 +0000 +++ b/src/keymap.c Sat Mar 14 00:07:50 2015 +0000 @@ -1582,6 +1582,9 @@ event2 = Fcharacter_to_event (key_specifier, Qnil, Qnil, Qnil); if (XEVENT (event2)->event_type != key_press_event) retval = 0; + else if (EQ (XEVENT_KEY_KEYSYM (event), XEVENT_KEY_KEYSYM (event2)) && + XEVENT_KEY_MODIFIERS (event) == XEVENT_KEY_MODIFIERS (event2)) + retval = 1; else if (CONSOLE_TTY_P (XCONSOLE (XEVENT_CHANNEL (event)))) { int ch1, ch2; @@ -1590,9 +1593,6 @@ ch2 = event_to_character (event2, 0, 0); retval = (ch1 >= 0 && ch2 >= 0 && ch1 == ch2); } - else if (EQ (XEVENT_KEY_KEYSYM (event), XEVENT_KEY_KEYSYM (event2)) && - XEVENT_KEY_MODIFIERS (event) == XEVENT_KEY_MODIFIERS (event2)) - retval = 1; else retval = 0; Fdeallocate_event (event2);