ThoNohT / NohBoard

A Keyboard Visualizer
GNU General Public License v2.0
1.04k stars 173 forks source link

Unexpected behavior of key code 20 (Caps Lock) #213

Open jtrynlds opened 6 days ago

jtrynlds commented 6 days ago

The way NohBoard displays key code 20 seems to alternate between two behaviors: the expected behavior where the key code is read while Caps Lock is being held, and an unexpected behavior where the indicator toggles when Caps Lock is pressed. Oddly the indicator doesn't necessarily correspond to caps lock being turned on, in fact it more often seems to be the reverse behavior, where the indicator is on while caps lock is off. The unexpected behavior begins happening when I short press the caps lock key (for less than about 500ms) and reverts to the expected behavior when I long press the Shift key (for more than about 500ms).

I was unable to reproduce this behavior by writing Python scripts to indicate when the Caps Lock key is being held, either using the keyboard, pynput, or ctypes library, which suggests that the problem is not OS-level.

https://chatgpt.com/share/6713d47d-4960-8003-9869-293729ea5b8c

jtrynlds commented 6 days ago

Key code 1026 works as expected.