spiegel-keyman/windows
Marc Durdin 83251358b0 fix(windows): reinstall low level keyboard hook if it gets removed 🍒
This change improves the stability of Keyman for Windows by monitoring
the health of the low level keyboard hook. If keyman.exe is unresponsive
at any time, Windows can silently uninstall its low level keyboard hook,
which results in (at least) two problems:

* Keyman's hotkeys stop working
* A modifier key can become stuck, if it was pressed around the time
  Keyman became unresponsive.

The most common scenario in which Keyman can become unresponsive is high
system load, e.g. rendering graphics, videoconference calls, compiling
software.

Restarting Keyman always resolved both of these two issues in the past,
but with this patch, I hope that this will no longer be necessary.

A related 'fakefreeze' project is not included in this cherry-pick; see
PR #15179 for this.

Logging has been updated; look for "LowLevelHookWatchDog" in the log for
related events.

One final small change in keyman32.cpp, as I refactored the
WH_KEYBOARD_LL hook installation/uninstallation, was to always clear out
hook variables when uninstalling a hook, because if the hook fails to
uninstall, there's really nothing we can do about it anyway, and we
probably shouldn't be trying again.

Fixes: #8064
Cherry-pick-of: #15179
Test-bot: skip
Build-bot: skip
2025-11-21 16:00:28 +01:00
..
docs docs(windows): update FAQ 2025-04-16 11:56:46 +02:00
include chore(windows): move kmtip_guids.h and testkeymanfunctioning.h 2022-06-12 07:43:24 +10:00
src fix(windows): reinstall low level keyboard hook if it gets removed 🍒 2025-11-21 16:00:28 +01:00
build.sh chore(windows): add new build scripts for Windows builds 2024-05-20 08:27:31 +07:00