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.

  • Based on my experience with issues like that, it seems unlikely to be an emacs issue, does the same thing ever happen in other applications?
    – ian
    Nov 14 '19 at 16:27
  • Found an easier workaround to get the caps lock working again: press the Windows key three times. (The first gets ignored, the second opens the start menu, the third closes it.)
    – Arry
    Dec 3 '19 at 8:25
  • You've done a good job detailing the problem, as well as demonstrating effort trying to resolve it. Both of those are good and appreciated. Unfortunately, we don't have a reliable way to reproduce the issue. Since you say it's minimal, can you please provide your init.el? The issue clearly depends on state. Without the init, I'm not sure how anyone could identify the culprit. Dec 15 '19 at 14:05
  • Before posting your init, actually, in response to your question, have you tried: stackoverflow.com/a/23772957 If you can do the things Drew recommends, you'll likely narrow the issue down to a question which is more specific than "why doesn't this work?" Dec 15 '19 at 14:08
  • I'm pretty sure that this is an issue with Windows 10 capturing the key events at some point (judging by the fact that the problem reliably goes away when you press the Windows key after it occurs), and this will occur with a clean Emacs init file. Thank you for the suggestion though.
    – Arry
    Dec 20 '19 at 11:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.