Chromium windows silently block Windows low-level keyboard hooks, developer finds
A developer building a push-to-talk dictation app for Windows discovered that global keyboard hooks using WH_KEYBOARD_LL stop receiving events whenever a Chromium-based window — including Electron and CEF apps — is in focus. No error or unhook signal is triggered; keystrokes reach the focused app normally but bypass the hook entirely. The issue traces to Windows silently skipping or removing hooks that exceed the LowLevelHooksTimeout budget, with Chromium's high-frequency input handling likely pushing callbacks past that threshold. Diagnosing the bug proved especially difficult because installing a secondary logging hook altered the hook chain order, inadvertently fixing the timing and masking the problem. The developer resolved it by handling keyboard events inside the WebView2 page directly when their own window has focus, and recommends keeping hook callbacks minimal and using GetAsyncKeyState polling to detect and reinstall dropped hooks.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in