Mercurial > hg > xemacs-beta
changeset 5858:36934833b4f3
#'event-matches-key-specifier-p, check keysyms and modifiers too on TTY
src/ChangeLog addition:
2015-03-14 Aidan Kehoe <kehoea@parhasard.net>
* 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.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sat, 14 Mar 2015 00:07:50 +0000 |
parents | 6ec4964c1687 |
children | 5423bb35a956 |
files | src/ChangeLog src/keymap.c |
diffstat | 2 files changed, 13 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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 <kehoea@parhasard.net> + + * 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 <kehoea@parhasard.net> * event-stream.c (lookup_command_event):
--- 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);