mirror of
https://github.com/rkd77/elinks.git
synced 2024-10-04 04:14:18 -04:00
terminal UTF-8: check_kbd_label_key() allows non-ASCII characters again.
All of its callers now use unicode_fold_label_case() rather than toupper(), if CONFIG_UTF_8 is defined.
This commit is contained in:
parent
6773c8505d
commit
5737cc546b
@ -170,17 +170,7 @@ void in_term(struct terminal *);
|
||||
#define check_kbd_modifier(event, mod) (kbd_modifier_is(&(event)->info.keyboard, (mod)))
|
||||
|
||||
#define check_kbd_textinput_key(event) (get_kbd_key(event) >= ' ' && check_kbd_modifier(event, KBD_MOD_NONE))
|
||||
#ifdef CONFIG_UTF_8
|
||||
/* We must currently limit hotkeys of labels to ASCII, because
|
||||
* get_kbd_key(event) is in UCS-4 and various event handlers pass it
|
||||
* to toupper() if check_kbd_label_key() returns true.
|
||||
* TO DO: Change the event handlers to use unicode_fold_label_case()
|
||||
* instead. The code that extracts the hotkey from the label string
|
||||
* will also have to be changed. */
|
||||
#define check_kbd_label_key(event) (get_kbd_key(event) > ' ' && get_kbd_key(event) <= 0x7F && (check_kbd_modifier(event, KBD_MOD_NONE) || check_kbd_modifier(event, KBD_MOD_ALT)))
|
||||
#else /* !CONFIG_UTF_8 */
|
||||
#define check_kbd_label_key(event) (get_kbd_key(event) > ' ' && (check_kbd_modifier(event, KBD_MOD_NONE) || check_kbd_modifier(event, KBD_MOD_ALT)))
|
||||
#endif /* !CONFIG_UTF_8 */
|
||||
|
||||
|
||||
/* For mouse events handling */
|
||||
|
Loading…
Reference in New Issue
Block a user