Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Caps Lock Behaviour Disabled in Gnome (popey.com)
35 points by zdw on Sept 28, 2023 | hide | past | favorite | 44 comments


Better than disabling capslock is to remap it to left control. In Windows, you can use SharpKeys [0] to update the registry to reconfigure behavior, or just use autohotkey (SharpKeys can't flip meanings, only overwrite one), although AHK won't work while you're logging into your user account on startup so SharpKeys is nicer. Not sure about Linux but I'm sure it's possible.

Never having to reach all the way to the actual Left Ctrl button is actually a godsend, it's a much much nicer UX.

[0] http://www.randyrants.com/category/sharpkeys/


Sharpkeys can swap keys, the readme says as much:

> Things that SharpKeys will do:

> ...

> Allow you to swap two keys with each other - e.g. you can swap Left Windows with Left Control and vice versa

I do have a vague recollection of Sharpkeys previously saying that it couldn’t, but that I tried and it worked. Long time since I last used Windows though.

https://github.com/randyrants/sharpkeys#things-that-sharpkey...


Oh huh, I didn't even bother looking at the README when I wrote that, because I remembered so well that it was unable to do this. In fact, that's why I went for the CapsLock rebind in the first place - I originally just wanted a solution for my Lenovo laptop having Fn in the Ctrl spot, prior to Lenovo allowing you to customize this in BIOS.

I found SharpKeys, but it wouldn't let me swap fn/ctrl. But while I was searching for how to do this, I came across some people who suggested remapping CapsLock to Ctrl, and I figured that was good enough, since it would still accomplish my original purpose, which was not to have to deal with 2 different muscle memories when using PC vs laptop.

This was back in 2009 so many versions of Windows ago, that's cool that you can do it now. Although I'm quite glad I chose to remap CapsLock as Ctrl, so I'm glad it wasn't possible back then!


You don't even need sharpkeys, it can be done with powertoys or with a simple native registry value.

That said, powertoy's remapping doesn't honor the remap in task manager, I'm not sure if this is a big deal or not.


I prefer dual-key-remap[0], it maps caps to escape when tapped and control when pressed with other keys.

[0] https://github.com/ililim/dual-key-remap


Oh that sounds pretty neat! In particular would make Ctrl+Shift+Esc easier to press to open the task manager, using the actual left-ctrl button for its intended purpose. I have pretty small hands so even pressing shift+capslock+esc is a bit of a reach. Thanks for linking this!


> Not sure about Linux but I'm sure it's possible.

Lots of ways to do it, and I've probably used most of them over the years. Right now on Linux Mint, it's an option in the keyboard layout.


One of the incantations I've committed to memory:

setxkbmap -option ctrl:swapcaps

This used to be universal, but as that I type that, it occurs to me it won't work under Wayland. I really should try out Wayland so I can learn the new way.


I map capslock to Command on macOS and Control on everything else. For many shortcuts (think copy-paste) muscle memory works across OSes.


Even better make it mod on hold and something else on tap (like showing you an app launcher).


macOS can do this right in keyboard settings under modifier keys.

It can be nice just to get rid of craps lock.


PowerToys also can do this, which I use to map Capslock to Esc


I find the Compose feature to be quite useful, so I used to have Compose key on Caps Lock on Linux. After I’ve switched back to Windows, I found WinCompose to be a pretty decent equivalent of Compose for Windows, and found out it can also override Caps Lock behaviour (though in about 1% of cases the default Windows Caps Lock behaviour breaks through for a brief moment) and reassign the Caps Lock function to some other, less frequent combination of keys. In my case pressing both Shifts at the same time acts as a Caps Lock toggle.


What is a compose feature?

(edit: looked it up, and it seems to be a way to enter accented keyboard characters like é or ñ. It's standard on macos, and I guess in Linux you bind a key to it?)


It allows you to access more characters than would usually be accessible on the keyboard, such as diacritical marks and currency symbols.


Thanks! Sounds like the opt key on Macs or the AltGr key on some international keyboards


Just another form of shift key. Shift itself is a compose key.


Not really: shift must be used simultaneously and you only input a single key to be shifted, while compose takes a (“dead”?) sequence of inputs to be combined.


yes really. it's all the same thing. shift is just a simpler and more common subset. you are getting a glyph by composing from more than one key. whether ypu can let go of the key to do them in serial is immaterial. anyone could have an accessability setup for instance that allows shift to require only a single physical keypress at a time. It would still be shift.


How can I input ° for example with Shift?

It's "AltGr o o" but I haven't seen how to do it with Shift.


It's immaterial if some key on some keyboard in some language happens to have a key that produces that glyph by composing with shift, or not.

If you asked how to type numbers, and I said "same way you type letters", that does not mean by typing "A" and wondering why it didn't produce "1".

The question was what is a compose key or what does compose key mean.

Shift is an example of a compose key that everyone is familar with, just no one calls it that. But everyone already understands what the shift key does. If you know what the shift key is and how to use it and what it does, then you know what a compose key is. It's that.

All the other possible compose keys just do exactly that same thing, just more of it for more and different glyphs and control codes.


I understand you mean compose as a generic term for a symbol modifier? But for the compose key, the word composition is used as a synonym of combination, and that of a set of symbols; which is not the case of shifting each symbol into a corresponding set.

I agree that ctrl/alt/meta/shift are somewhat synonymous, and all those+compose are just instances of modifier keys.

But this combination meaning is specifically what makes the compose-key distinction useful and clear.


No not symbol modifier. Compose.

To get a particular glyph, or control code, you have to compose it out of multiple keypresses.

Some common examples happen to be modified versions of whatever glyph happens to be on a key, but that is just a subset, arranged that way for human sanity, humans would hate it if you had to press shift+g to get A, and really only in the latin languages whose writing even works that way. The glyphs could actually be anything, and outside of the latin languages they are. The poop emoji is not a modified form of any number or letter.

And it's not even just glyphs but any byte or byte sequence you want to produce. A single 0x01 byte is not a glyph, nor a modified form of any glyph, but you can still type it, and it's composed of the CTRL key and the A key.


You’ve misunderstood. No one said that they were equivalent, only that there was no functional difference between them. They certainly allow you to access different characters, but whether you hold down shift and then type a “d” to input a capital “D” or you tap shift and then tap the “d” to get the same result is merely a software setting that you can toggle. The same is true for AltGr and compose keys. You can configure your OS to require them to be typed as chords or as dead keys, whichever you prefer.

See also the space–cadet keyboard (<https://en.wikipedia.org/wiki/Space-cadet_keyboard#/media/Fi...>), which had no fewer than seven such keys labeled control, meta, super, hyper, shift, front, and top.


Fun fact: macOS adds a default delay to the CapsLock to prevent this. Quick tap will not enable CapsLock. Only long tap.

Also fun: when remapping the CapsLock to control key using default macOS tools this behaviour remains. Eg: Mapping it to ctrl and trying to exit a shell command with ctrl+c only works with a long press. Super annoying.

Like all things on macOS you need a third party tool, like carabiner.


Is there a way to do this on windows? After switching from a Mac to a pc with a Keychron mechanical keyboard I AM SUDDENLY SHOUTING ALL MY PASSWORDS

The issue is a mix of me being used to super flat Mac keys and not having that caps lock delay


holy shit, for years I've though that the capslock is just bugged, usually had to press it twice, because it didn't register, but other keys were working correctly.

what a stupid hidden behaviour, no wonder that the whole apple ecosystem is pissing me off.

EDIT: had to search for it, just can't believe how stupid it is: https://www.reddit.com/r/macbook/comments/o6q52c/mba_m1_caps...


I know right! I mean, I can understand doing this when CapsLock feature is actually enabled. But when disabled and key is remapped to another function? Very annoying.


I'm curious now about what "caps lock behavior disabled" is, as opposed to "caps lock disabled."

I searched for it and couldn't really find anything that explained it.


My understanding is that the "disabled" radio option just means the Gnome Tweaks program won't override anything. Caps Lock behavior will be the system default, instead of being changed by Gnome Tweaks. The other one is "Gnome Tweaks will override Caps Lock to disable it"


I would assume it is "disable this tool changing the behavior". Something like "default" would avoid the ambiguity, but maybe "disabled" works better for other settings the tool can tweak and they want to be consistent?


It might mean that the key itself is not disabled and thus free to be bound to some other action, but I agree that the remark sounds a bit odd.


I'm somewhat disturbed by the fact that the list of possible behaviors does not contain equivalent of -xkboption ctrl:swapcaps, ie. swap caps lock and left control.


Caps lock is left control (or backspace). Both shift keys pressed together is caps lock. I rebind scroll lock to hyper as well and bing a few well chosen Emacs functions to hyper+[1-9]

You can have it all. The next thing will be keyboard manufacturers realising that you can get 2 extra modifiers in the bottom row by making the space-bar narrower.


Okay, now do colemak in login screen so I can type my password in without having to use a visual keyboard.


Translate your password such that you remember it as the Colemak keycaps as typed on the QWERTY layout? eg foobar -> tyybap.


Wouldn't work elsewhere, eg sudo.


What display manager do you use? GDM does allow you to choose a different keyboard layout on the login screen.


lightdm, looks like. I'm not entirely sure how, but I've got some hacky version of unity still chugging along.


Nice. Well, now you know what to change/upgrade.


I am using the same keyboard for Linux and Windows. I disabled the Keylock for both OS, by rolling a piece of metal under the key. Nothing visible. Case solved.

Could have changed it in Linux but the others OS is for work and I can't install or modify anything on that computer.


Nice. There are a lot of obscure and wonderful options in there, but that is the funniest.


Do not reveal the existence of that menu to gnome developers if you want it to live.


I prefer mapping Caps Lock to Hyper, for an extra Emacs modifier.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: