-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: better handling of Windows LLHOOK stuck keys
There are two changes in this commit. 1) Always live reload after ~1s. After 1 second if live reload is still not done, there might be a key in a stuck state. One known instance where this happens is Win+L to lock the screen when on Windows and using the LLHOOK mechanism. The release of Win and L keys will not be caught by the kanata process when on the lock screen. However, the OS knows that these keys have released - only the kanata state is wrong. And since kanata has a key in a stuck state, without this 1s fallback, live reload would never activate. Having this fallback allows live reload to happen which resets the kanata states. 2) Clear normal states (not fake key) after blocking for a while This code only runs in the LLHOOK Windows version. The reason for this existing is the same as in 1). The main motivator is the Win+L example. The thought is that after locking their screen, the user will probably go away for a while. The software can detect that the zero user inputs were input for extended period of time and assume that keys got stuck.
- Loading branch information
Showing
2 changed files
with
70 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters