Hacker News new | ask | show | jobs
by Cthulhu_ 866 days ago
I mean sure, in theory something else can activate caps lock. In practice, it's only ever activated through a button press on the keyboard used. Caps lock being activated by something else or being reassigned to another button is the edge case here.
1 comments

A laptop with external keyboard is not exactly an edge case. In Windows the caps lock state is per session, not per keyboard and I believe this is the case with most Linux desktops, the Mac is an exception here. Even there, the other case you are missing in your truth table is button depressed when not connected (ie the initial state). None of the common OS have locking support out of the box.

> Caps lock being activated by something else or being reassigned to another button is the edge case here.

BS. There is more variety to the assignment of the caps lock key then I think you realize even if in isolation some of them are edge cases (input method switching is a big one). https://support.apple.com/en-euro/guide/mac-help/mchl84525d7... Windows has similar including chords in the standard configuration for Japanese on non Japanese keyboards.

I think pointing out edge cases while ignoring that the request is for something that doesn’t exist with no evidence of high demand is an edge case is quite silly.

I was going to say just get a Cherry MX lock and pop it in, but those have been discontinued for what seem to me to be obvious reasons.

Why does the keyboard send caps lock? I assumed it would either send capital character or lowercase character.
That’s not how it works because it is more flexible and sensible to do the translation of a physical key location to a logical function within the OS. While fancier keyboards do allow alternate key maps and macros, your basic standard keyboard is just a stateless matrix of numbers (scan codes). Any hardwired button state handling or latching diminishes straightforward programmability on the OS side.

Understand that you can configure any modern OS for any arbitrary keyboard layout regardless of what type of keyboard is connected. The keyboard itself has no concept of what is a capital letter and what is a lowercase letter, it’s just buttons. This makes sense, because at the end of the day touch typists don’t really care what is printed on the keycaps. If I want to use Chinese (eg pinyin), Japanese (which is a cluster of layouts), or Dvorak on a US keyboard why should it matter? This can be handled easily in the OS, the keyboard is dumb.

And the concept of uppercase and lowercase as it would apply to a QWERTY layout doesn’t make even make sense for many languages.

When you press the physical caps lock key you’re just sending a number just like the Q key or something. The OS decides what to do with it. I have virtually no use for caps lock personally so it’s a control key. Using it as a dual purpose key for input method switching is not uncommon. More generally another reason for not baking in functionality in the keyboard is provision of accessibility features such as Sticky Keys and Filter Keys.