The classic IBM PS2 keyboard features 3 specialized lock buttons: Caps Locks (also known as Shift Lock), Num Lock and Scroll Lock. All of them act as a toggle switch and have a hardware LED on some keyboard what shows the state. Most known is the caps lock key, as it prevents from login with a correct password if activated while Scroll Lock has only little use and Num Lock is not available for keyboards without seperate number block keys.
For the USB area HID keyboards also have this 3 lock buttons. Unlike PS keyboards, USB allows to have more than one keyboard for any target PC. Therefore the USB endpoint of all keyboards receive the lock state of each key. With other words: If you have 2 keyboards and press Caps Lock at one of them, the appropriate LED will lid on both keyboards. This feature might be used to transmit lock key sequences from a keyboard to another HID device what might be not a keyboard.
For my Ubuntu 22.04.4 LTS installation, caps and num lock are working fine while scroll lock shows no functionality. You might reproduce this using a cheap Cherry KC1000 oder other full feature keyboard what comes with 3 LEDs and appropriate lock switches therefore. Num-Lock and caps-lock toggle the LED while the scroll lock led is always off.
During the boot process, caps lock works fine as it is controlled by the bios code at a time we do not know what OS will boot. The moment Ubuntu makes the HID enumeration Scroll Lock will stop working.
I used this java script to see what happens:
https://www.toptal.com/developers/keycode
here we see event code 20 for caps lock, event code 144 for num lock and 145 for scroll lock. All my Windoz machines transmit the LED state to HID endpoint correct. Ubuntu is doing so only for the caps lock and num lock states while the scroll lock state will be dropped. What I heard about MacOS, it will transmit the lock states only to the own HID endpoint but not to any parallel HID keyboards. Maybe there is a reason why Ubuntu drops the scroll lock or there is any possibility for configuration ?
Bookmarks