diff options
| author | Igor Soarez <igor@soarez.org> | 2026-10-01 18:05:25 +0300 |
|---|---|---|
| committer | Igor Soarez <igor@soarez.org> | 2026-10-01 18:05:25 +0300 |
| commit | 6c7eb1b380cec100663c7c11d0252f9e6b46d34a (patch) | |
| tree | 572c254c008df0dad812476850711e3861349c31 /bin/theme | |
| parent | 7fc9494ac2b7d905cebff10ff5b8be5a3de80403 (diff) | |
hammerspoon: Caps Lock sends F20, and stays that way
hidutil remaps inside the IOKit HID driver, below the window server, so the
key stops being Caps Lock before anything above the driver sees it: no toggle
to suppress, and F20 is a real key to other apps, to System Settings
shortcuts, to a password field. An eventtap cannot do this -- Caps Lock is not
reachable from there, which is why hs.hid exists as its own IOKit module.
What hidutil will not do is cover a keyboard attached after it ran, so dotlib
re-applies on USB attach, on wake, and on a Caps Lock event. That last one is
the general answer: a mapped keyboard cannot produce a Caps Lock event, so an
event arriving at all is proof of a keyboard the remap missed, and the fault
triggers its own repair. The watchers are there to get the common cases before
a key is pressed, since the repairing press is spent repairing.
No launchd job and no link/ part. The remap lives and dies with Hammerspoon,
which already owns the keyboard on these machines, and a plist would only have
bought independence from it for the second or two before it starts -- a user
agent does not run at the login window either.
Nothing is bound to f20 here; bind it like any other key. A machine gives the
key back with capslock_off() from its local.lua, which loads last: shadowing
cannot undo a side effect that has already run. hs.ipc is required so
capslock_status() answers from a shell.
Diffstat (limited to 'bin/theme')
0 files changed, 0 insertions, 0 deletions
