boppreh / keyboard

Hook and simulate global keyboard events on Windows and Linux.
MIT License
3.74k stars 432 forks source link

Returns upper and lower cases on Windows but only lower cases on Linux #638

Open TheConceptBoy opened 4 months ago

TheConceptBoy commented 4 months ago

I used the library to get keyboard inputs into my application and I found a strange ill regularity. When testing on Windows, the print result shows capital or lower case letters based on whether or not I'm holding down the shift key. However when testing on Debian linux, it seems to only report lower cases regardless if I am holding down shift or not. As the matter of fact this also affects punctuation symbols, special characters and brackets. Shift 5 still shows up as 5 Is this something that's unavoidable or is there something I'm missing ?

import keyboard

while True:
    event = keyboard.read_event()
    if event.event_type == keyboard.KEY_DOWN:
        print(dir(event))
        print('key pressed', event.name)