From 69eb5f7b8c712482bb960f49e5c9ec717a902858 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 24 Oct 2014 05:28:16 +0200 Subject: check if keycode exists first, since keystate can be outta whack --- opentrack/shortcuts.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opentrack/shortcuts.cpp b/opentrack/shortcuts.cpp index 6ccefef9..851c5826 100644 --- a/opentrack/shortcuts.cpp +++ b/opentrack/shortcuts.cpp @@ -94,7 +94,8 @@ static bool isKeyPressed( const Key *key, const BYTE *keystate ) { bool ctrl; bool alt; - if (keystate[key->keycode] & 0x80) { + if (key->keycode != 0 && keystate[key->keycode] & 0x80) + { shift = ( (keystate[DIK_LSHIFT] & 0x80) || (keystate[DIK_RSHIFT] & 0x80) ); ctrl = ( (keystate[DIK_LCONTROL] & 0x80) || (keystate[DIK_RCONTROL] & 0x80) ); alt = ( (keystate[DIK_LALT] & 0x80) || (keystate[DIK_RALT] & 0x80) ); -- cgit v1.2.3