- added 'nokeyrepeat' option for the win32 gui

This commit is contained in:
Volker Ruppert 2011-12-04 21:15:35 +00:00
parent eafa122339
commit 34644308f7

View File

@ -100,6 +100,7 @@ static BOOL mouseCaptureMode, mouseCaptureNew, mouseToggleReq;
static UINT_PTR workerThread = 0;
static DWORD workerThreadID = 0;
static int mouse_buttons = 3;
static bx_bool win32_nokeyrepeat = 0;
// Graphics screen stuff
static unsigned x_tilesize = 0, y_tilesize = 0;
@ -629,7 +630,10 @@ void bx_win32_gui_c::specific_init(int argc, char **argv, unsigned
if (argc > 1) {
for (i = 1; i < argc; i++) {
BX_INFO(("option %d: %s", i, argv[i]));
if (!strcmp(argv[i], "legacyF12")) {
if (!strcmp(argv[i], "nokeyrepeat")) {
BX_INFO(("disabled host keyboard repeat"));
win32_nokeyrepeat = 1;
} else if (!strcmp(argv[i], "legacyF12")) {
BX_PANIC(("The option 'legacyF12' is now deprecated - use 'mouse: toggle=f12' instead"));
#if BX_DEBUGGER && BX_DEBUGGER_GUI
} else if (!strcmp(argv[i], "gui_debug")) {
@ -1236,7 +1240,9 @@ LRESULT CALLBACK simWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
return 0;
}
EnterCriticalSection(&stInfo.keyCS);
if (((lParam & 0x40000000) == 0) || !win32_nokeyrepeat) {
enq_key_event(HIWORD (lParam) & 0x01FF, BX_KEY_PRESSED);
}
LeaveCriticalSection(&stInfo.keyCS);
return 0;