Skip to content

Commit 174dc83

Browse files
committed
fix: Win+Space 토글 후 시작 메뉴가 열리는 문제 수정
Win+Space로 Colemak 토글 시 Space를 차단(return 1)하면 Windows가 Win 키 해제를 단독 입력으로 인식하여 시작 메뉴가 열리는 문제 수정. 토글 후 더미 키(0xFF) down+up을 주입하여 Win이 조합키로 사용되었음을 셸에 알림.
1 parent 22e295e commit 174dc83

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎src/key_handler.c‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,24 @@ LRESULT CALLBACK KolemakLowLevelKeyboardProc(int nCode, WPARAM wParam,
183183
{
184184
s_toggleKeyDown = TRUE;
185185
FlushAndToggleColemak(ts);
186+
187+
/* Inject no-op key to prevent Start menu.
188+
* Blocking Win+Space causes Windows to
189+
* treat Win release as standalone press;
190+
* a dummy keypress clears that state. */
191+
{
192+
INPUT noop[2] = {{0}, {0}};
193+
noop[0].type = INPUT_KEYBOARD;
194+
noop[0].ki.wVk = 0xFF;
195+
noop[0].ki.dwExtraInfo =
196+
KOLEMAK_LL_INJECTED;
197+
noop[1].type = INPUT_KEYBOARD;
198+
noop[1].ki.wVk = 0xFF;
199+
noop[1].ki.dwFlags = KEYEVENTF_KEYUP;
200+
noop[1].ki.dwExtraInfo =
201+
KOLEMAK_LL_INJECTED;
202+
SendInput(2, noop, sizeof(INPUT));
203+
}
186204
return 1;
187205
}
188206
}

0 commit comments

Comments
 (0)