log more about tracking key state between window defocus

This commit is contained in:
David Rose 2003-07-03 20:28:19 +00:00
parent e1d4f45ae0
commit a8a74ed9d5

View File

@ -225,7 +225,7 @@ open_window() {
// need to do twice to override any minimized flags in StartProcessInfo // need to do twice to override any minimized flags in StartProcessInfo
ShowWindow(_hWnd, SW_SHOWNORMAL); ShowWindow(_hWnd, SW_SHOWNORMAL);
ShowWindow(_hWnd, SW_SHOWNORMAL); ShowWindow(_hWnd, SW_SHOWNORMAL);
if (!SetForegroundWindow(_hWnd)) { if (!SetForegroundWindow(_hWnd)) {
windisplay_cat.warning() windisplay_cat.warning()
<< "SetForegroundWindow() failed!\n"; << "SetForegroundWindow() failed!\n";
@ -978,8 +978,8 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
// GetKeyboardState logic, below. The above check filters out // GetKeyboardState logic, below. The above check filters out
// this case (while testing GetFocus() instead of // this case (while testing GetFocus() instead of
// GetForegroundWindow() doesn't). // GetForegroundWindow() doesn't).
if(windisplay_cat.is_debug()) windisplay_cat.info()
windisplay_cat.debug() << "Ignoring non-foreground WM_SETFOCUS\n"; << "Ignoring non-foreground WM_SETFOCUS\n";
break; break;
} }
@ -997,10 +997,17 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
// This key has changed state. // This key has changed state.
if ((new_keyboard_state[i] & 0x80) != 0) { if ((new_keyboard_state[i] & 0x80) != 0) {
// The key is now held down. // The key is now held down.
// cerr << "key is down: " << lookup_key(i) << "\n"; if (windisplay_cat.is_debug()) {
windisplay_cat.debug()
<< "key is down: " << lookup_key(i) << "\n";
}
handle_keyresume(lookup_key(i)); handle_keyresume(lookup_key(i));
} else { } else {
// The key is now released. // The key is now released.
if (windisplay_cat.is_debug()) {
windisplay_cat.debug()
<< "key is up: " << lookup_key(i) << "\n";
}
handle_keyrelease(lookup_key(i)); handle_keyrelease(lookup_key(i));
} }
} }