Fixed repetition on Caps Lock.

This commit is contained in:
Quantum 2014-09-08 10:41:18 -04:00
parent cf4aa335c6
commit e4b1154606
2 changed files with 7 additions and 1 deletions

View file

@ -56,6 +56,7 @@ protected:
virtual HICON GetIcon();
int active[128];
bool capsDown;
bool useBeep;
HANDLE hBeep;
unsigned lastFrequency;

View file

@ -266,7 +266,7 @@ LRESULT MainWindow::OnCreate()
F_RtlInitUnicodeString(&usBeepDevice, L"\\Device\\Beep");
hBeep = NULL;
}
useBeep = false;
capsDown = useBeep = false;
m_keychars = NULL;
PostMessage(m_hwnd, WM_INPUTLANGCHANGE, 0, 0);
return 0;
@ -496,10 +496,15 @@ LRESULT CALLBACK MainWindow::LowLevelKeyboardHook(HHOOK hHook, int nCode, WPARAM
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
down = true;
if (capsDown)
goto finish;
else
capsDown = true;
break;
case WM_KEYUP:
case WM_SYSKEYUP:
down = false;
capsDown = false;
break;
default:
goto finish;