From dbffd4eb7bd8460333b9bad06de19d444354f37c Mon Sep 17 00:00:00 2001 From: ansstuff Date: Sat, 10 Nov 2012 17:16:01 +0000 Subject: [PATCH] * win32 hotkeys: disallow unwanted hits of e.g. F1 after pressing Shift+F1 and quickly releasing Shift * win32 hotkeys mapping: added the condition that both commands must have the same EMUCMDFLAG_TASEDITOR, or else they are not considered conflicting --- src/drivers/win/keyboard.cpp | 2 +- src/drivers/win/mapinput.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/drivers/win/keyboard.cpp b/src/drivers/win/keyboard.cpp index 74041ab5..09649f97 100644 --- a/src/drivers/win/keyboard.cpp +++ b/src/drivers/win/keyboard.cpp @@ -75,7 +75,7 @@ void KeyboardUpdateState(void) int notAlternateThrottle = !(soundoptions&SO_OLDUP) && soundo && ((NoWaiting&1)?(256*16):fps_scale) >= 64; #define KEY_REPEAT_INITIAL_DELAY ((!notAlternateThrottle) ? (16) : (64)) // must be >= 0 and <= 255 #define KEY_REPEAT_REPEATING_DELAY (6) // must be >= 1 and <= 255 -#define KEY_JUST_DOWN_DURATION (4) // must be >= 1 and <= 255 +#define KEY_JUST_DOWN_DURATION (1) // must be >= 1 and <= 255 // AnS: changed to 1 to disallow unwanted hits of e.g. F1 after pressing Shift+F1 and quickly releasing Shift for(int i = 0 ; i < 256 ; i++) if(tk[i]) diff --git a/src/drivers/win/mapinput.cpp b/src/drivers/win/mapinput.cpp index b68622f6..3937b88b 100644 --- a/src/drivers/win/mapinput.cpp +++ b/src/drivers/win/mapinput.cpp @@ -455,7 +455,9 @@ void PopulateConflictTable(int* conflictTable) for(unsigned int j = i + 1; j < EMUCMD_MAX; ++j) { if(FCEUD_CommandMapping[i] && - FCEUD_CommandMapping[i] == FCEUD_CommandMapping[j]) + FCEUD_CommandMapping[i] == FCEUD_CommandMapping[j] && + // AnS: added the condition that both commands must have the same EMUCMDFLAG_TASEDITOR, or else they are not considered conflicting + (FCEUI_CommandTable[i].flags & EMUCMDFLAG_TASEDITOR) == (FCEUI_CommandTable[j].flags & EMUCMDFLAG_TASEDITOR)) { conflictTable[i] = 1; conflictTable[j] = 1;