I'm running GNU Emacs 26.1 on Windows 10, with minimal customizations (custom shortcuts and command names, theme,
(ido-mode 'buffers).). At the start of the session, the Caps Lock state is recognized correctly - i.e. with Caps Lock on, the input is in uppercase; however, at a random time it stops working: with Caps Lock on, the input is in lowercase (in other apps it is working as expected).
C-h k a (with Caps Lock on) displays
a runs the command self-insert-command (found in global-map)
The problem goes away if I restart Emacs, but I'd rather not do that several times per day.
How do I debug this issue?
I thought about somehow setting a timer in Emacs and alert on the change in the condition, but it doesn't seem possible to detect the condition from within Elisp, because at the point of Elisp running it already sees the lowercase letters (per the
C-h k test above).
Systematically stopping the work every two minutes to manually check the condition and investigate what changed isn't an option either.
A possible work-around is to switch my workflow for entering uppercase letters from "Caps Lock, text, Caps Lock" to "text,
M-b M-u", but as it is a finger habit, it's very hard to change.