top | item 39221549

(no title)

Siecje | 2 years ago

Why does the keyboard send caps lock? I assumed it would either send capital character or lowercase character.

discuss

order

epcoa|2 years ago

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.