keyboard icon indicating copy to clipboard operation
keyboard copied to clipboard

Sending a scan code results in the wrong letter being outputted

Open Aran-Fey opened this issue 2 years ago • 0 comments

This issue seems to be related to keyboard layouts. I use colemak, which means pressing the E button on my keyboard actually results in the letter "F".

However, if I use keyboard.press to simulate a key press, it instead results in the letter "E". Here's a small demo:

def on_key_press(event):
    keyboard.press(event.scan_code)

keyboard.on_press_key(18, on_key_press, suppress=True)

Even though the code simply re-sends the same scan code, the E button now produces the letter "E" instead of "F".

OS: Windows 10

Aran-Fey avatar Jul 23 '22 07:07 Aran-Fey