I have this mnemonic keybinding which I placed in my config
;; Switching window backwards
(global-set-key (kbd "C-x O") (lambda ()
(interactive)
(other-window -1)))
Which works fine, but works in the opposite direction when my CAPS are on. I have tried
;; Switching window backwards
(global-set-key (kbd "C-x S-o") (lambda ()
(interactive)
(other-window -1)))
but this does not work at all, it just gives me the regular forward buffer
S-o
does not work. What doe Emacs receive when you typeo
with caps lock on? What doesC-h k
report?C-S-x O
which, by default, and if there's no direct binding, gets translated toC-x O
. That mechanism works fine so far as I can see, but I point it out in case it's relevant.C-h k C-x O
tell you when caps-lock is on (turn it on after you hitC-h k
, so thek
is lowercase)? (In my case it says "C-x o (translated from C-x O) runs the command other-window.") That should tell you why Emacs does what it does. It sounds like your keyboard/platform is maybe sending something unusual to Emacs.C-x S-o
. Now I triedC-x S-o
with caps on, and I got "C-x o runs the command...". This comes as no surprise though, as it is what I observed, the problem is that emacs does not seem to be able to differentiate whetherS
or <CAPS> is make a captial O. Could this be an OS specific issue? I use Ubuntu 20.04