Skip to content

Commit 4204e77

Browse files
committed
Long press tweak
Minor adjustment to the key up for long press that makes shortcuts like ctrl+c slightly less likely to fire if the ctrl key is released first.
1 parent 5e6ce09 commit 4204e77

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

KeyCapLib/keyboardproc.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
161161
&& !bShift
162162
&& pKeyDef->inputFlag.bLongPress)
163163
{
164-
if (g_KeyDownTime[pKeyDef->virtualKey] != KEY_DOWN_EVENT_FIRED)
164+
if (g_KeyDownTime[pKeyDef->virtualKey] != KEY_DOWN_EVENT_FIRED &&
165+
g_KeyDownTime[pKeyDef->virtualKey] != KEY_DOWN_UNSET)
165166
{
166167
const ULONGLONG tickCount = GetTickCount64();
167168
LogDebugMessage("Detected LONGPRESS Key UP (too short): %d Tick: %d (Old Tick: %d)", pKeyDef->virtualKey, tickCount, g_KeyDownTime[pKeyDef->virtualKey]);

0 commit comments

Comments
 (0)