commit 0e0fb452a314425c4bf4a0b8c618a51b72a7c238
parent f66432e999ff0fca33f5da4999808012e066ffcd
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 17 Dec 2017 12:04:14 +0100
input: optimize a bit for non-shortcut keys, as they are most frequent
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/winio.c b/src/winio.c
@@ -1764,6 +1764,10 @@ const sc *get_shortcut(int *kbinput)
*kbinput, meta_key ? "TRUE" : "FALSE");
#endif
+ /* Plain characters cannot be shortcuts, so just skip those. */
+ if (!meta_key && (*kbinput & 0x7F) >= 0x20 && *kbinput <= 0xFF)
+ return NULL;
+
for (s = sclist; s != NULL; s = s->next) {
if ((s->menus & currmenu) && *kbinput == s->keycode &&
meta_key == s->meta) {