I never use Caps Lock, so I disable the Caps Lock key completely with xmodmap, to avoid hitting it by accident.
Occasionally my X server gets into caps-lock state anyway. (Usually some complicated stunt was involved, like attaching x11vnc to the display remotely.) And then I can't turn it off again using the Caps Lock key.
So I wrote a tiny X client that lets me type 'xcapslock off' at a shell prompt …
… and then I had to make an alias to it, called 'XCAPSLOCK OFF'.
Alexandra Lanes likes this.
reshared this
PulkoMandy
in reply to Simon Tatham • • •Simon Tatham
in reply to PulkoMandy • • •PulkoMandy
in reply to Simon Tatham • • •I have this for numlock but I'm not entirely sure of what it does:
xmodmap -e 'keycode 77 = NoSymbol Num_Lock'
I didn't try caps lock yet, does it not have a keycode, or would it just be confused about shift?
Simon Tatham
in reply to PulkoMandy • • •@pulkomandy aha, nice! Generally 'keycode K = a b c d' means that K generates symbol a unshifted, b shifted, and I think c with AltGr and d with both modifiers.
xmodmap -e 'keycode 66 = NoSymbol Caps_Lock' is the Caps Lock equivalent of your Num Lock line. So I was wrong (or perhaps '25% wrong' 😀. You _can_ do it with plain xmodmap.
Simon Richter
in reply to Simon Tatham • • •Simon Tatham
Unknown parent • • •Al
in reply to Simon Tatham • • •Joel Baxter
in reply to Simon Tatham • • •petrisch
in reply to Simon Tatham • • •Alexander Dyas
in reply to Simon Tatham • • •Simon Tatham
in reply to Alexander Dyas • • •Lalufu
in reply to Simon Tatham • • •The downside is that you might have to do this for every keyboard you have on the system, as they don't necessarily agree on the low level key codes. Specifically the built-in laptop keyboard usually doesn't use USB key codes.
Simon Tatham
in reply to Lalufu • • •I must admit that I also cling to an old-fashioned idea that computers are still multi-user. Even my personal ones: I have been known to give other people accounts on them, and when those people use their accounts, they _don't_ want the effects of bizarre things like this intended for just me.
So I still think it makes more sense to put my preferences in my account, not systemwide. This is also a reason I haven't taken the Caps Lock keycap off.
Alexandra Lanes likes this.
Lalufu
in reply to Simon Tatham • • •Simon Tatham
in reply to Lalufu • • •@Lalufu though admittedly one flaw in this concept is the login screen. If I have a preferred keyboard layout that's not the systemwide one, I'd like to use it to type my password – especially since I'll _also_ sometimes need to type my password after logging in, and it's doubly annoying to do it in two different finger shapes!
I don't know if any login-screen software temporarily enables each user's keyboard preferences for their password prompt. Or even if it _could_, securely.
Alexandra Lanes
in reply to Simon Tatham • •trissc̈hen likes this.
bit101
in reply to Simon Tatham • • •I may have some aliases along those lines.
alias nordconnect="nordvpn connect"
Duncan MacGregor
in reply to Simon Tatham • • •Mike P
in reply to Simon Tatham • • •metalfabs
in reply to Simon Tatham • • •Andrew Zonenberg
in reply to Simon Tatham • • •Colin Watson
in reply to Simon Tatham • • •I actually use and like to have Caps Lock.
But I believe the Debian installer still contains a change I made when I discovered that the Brazilian Portuguese keyboard layout has 106 keys, and / is on the 106th key - so I had to be able to switch out of it manually without needing to type any absolute paths!
Roy #EatTheRich Pardee 🇺🇸
in reply to Simon Tatham • • •Robert J. Berger
in reply to Simon Tatham • • •Roger Light
in reply to Simon Tatham • • •GitHub - ralight/keycounts
GitHubJack
in reply to Simon Tatham • • •you don't really need the *lowercase* version of it, I guess! 😀
Hm. Now wondering if you can bind capslock to "capslock off" for maximum "do what you want" 😀
Simon Tatham
in reply to Jack • • •Jack
in reply to Simon Tatham • • •Simon Tatham
in reply to Jack • • •@jackv I think two reasons:
1. It assumes the _only_ use for the 'xcapslock' tool is to use it interactively on the command line. As soon as you find a use for the same tool in a script, you'll wish the syntax was more logical.
2. When you add the companion tool 'xnumlock', which has no analogous spelling variation in the command itself, you'll want both tools to have the same command-line syntax.
Anselm Schüler
in reply to Simon Tatham • • •Tony Finch
Unknown parent • • •Key Lock-outs
SPKeyboards@frueheneuzeit
in reply to Simon Tatham • • •Jill
in reply to Simon Tatham • • •Frank Wiles
in reply to Simon Tatham • • •Jacob Lewallen
in reply to Simon Tatham • • •Simon Tatham
in reply to Jacob Lewallen • • •Devlin Leathercraft
in reply to Simon Tatham • • •Simon Tatham
in reply to Devlin Leathercraft • • •Devlin Leathercraft
in reply to Simon Tatham • • •Rick O
in reply to Simon Tatham • • •Claudius
in reply to Simon Tatham • • •ospalh
in reply to Simon Tatham • • •Or no arguments and checking argv[0]s capitalization?
OK, i ges that is more work than an alias.
Kristian H. Kristensen
in reply to Simon Tatham • • •Simon Tatham
in reply to Kristian H. Kristensen • • •Kristian H. Kristensen
in reply to Simon Tatham • • •PC USB Triple Action Foot Switch(Black)
MobsparesAlexandra Lanes
in reply to Kristian H. Kristensen • •like this
Simon Tatham and Marius Gedminas like this.
Kristian H. Kristensen
in reply to Alexandra Lanes • • •Alexandra Lanes likes this.
Rob Carlson
in reply to Simon Tatham • • •Nina "Erina" Satragno 💫
in reply to Simon Tatham • • •I map caps lock to escape and escape to caps lock. I'm never hitting the escape key by accident.
It's obviously great for vim, but even better for StarCraft.
Mans R
in reply to Simon Tatham • • •Michael Wolf
in reply to Simon Tatham • • •Valentin Sawadski
in reply to Simon Tatham • • •My favorite use for caps lock is what the Neo2 keyboard layout uses it for: A modifier key, that when pressed maps “programming characters” like ( [ { to the home row for ergonomic typing.
See Layer 2 here en.wikipedia.org/wiki/Neo_(key…
P.S. Might be a bigger deal in German keyboard layout where these characters are very hard to reach 🤷♂️
German keyboard layout
Contributors to Wikimedia projects (Wikimedia Foundation, Inc.)steelman
in reply to Simon Tatham • • •Thom.
in reply to Simon Tatham • • •