Don't allow shortcuts with Ctrl+Alt because on Windows they can be used as the AltGr... terencehill/keys 58/head
authorterencehill <piuntn@gmail.com>
Tue, 9 Apr 2019 15:55:40 +0000 (17:55 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 9 Apr 2019 15:55:40 +0000 (17:55 +0200)
keys.c

diff --git a/keys.c b/keys.c
index e93f83a..d13c25d 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -726,6 +726,11 @@ Key_Console (int key, int unicode)
                break;
        }
 
+       // Don't allow shortcuts with Ctrl+Alt because on Windows they can be used
+       // as the AltGr key (which generates Ctrl+Alt) to type special characters
+       if (keydown[K_CTRL] && keydown[K_ALT])
+               goto add_char;
+
        if ((key == 'v' && keydown[K_CTRL]) || ((key == K_INS || key == K_KP_INS) && keydown[K_SHIFT]))
        {
                char *cbd, *p;
@@ -1154,6 +1159,8 @@ Key_Console (int key, int unicode)
                return;
        }
 
+       add_char:
+
        // non printable
        if (unicode < 32)
                return;