pynput icon indicating copy to clipboard operation
pynput copied to clipboard

Certain keys not being parsed correctly after upgrade to Ubuntu LTS 22.04

Open nemwiz opened this issue 3 years ago • 2 comments

Description After upgrading to the latest Ubuntu version, some of the keys stopped working. I've debugged a bit and it seems that the key is incorrectly parsed. See below for examples.

Platform and pynput version Ubuntu LTS 22.04 Python v 3.10.4 Pynput 1.7.6

To Reproduce Non working code

from pynput import keyboard

def hotkeys_pressed():
    print('Event triggered')


key_combinations = {'<ctrl>+<alt>+<page_up>': hotkeys_pressed}

with keyboard.GlobalHotKeys(key_combinations) as hotkey:
    hotkey.join()

After debugging, I've changed my hotkeys to this and it works. It seems that the canonical function returns incorrect value.

from pynput import keyboard

def hotkeys_pressed():
    print('Event triggered')


key_combinations = {'<ctrl>+<alt>+<65365>': hotkeys_pressed}

with keyboard.GlobalHotKeys(key_combinations) as hotkey:
    hotkey.join()

nemwiz avatar Sep 10 '22 23:09 nemwiz

Same for me. '<f1>' not works while '<65470>' works.

yusanshi avatar Sep 30 '22 07:09 yusanshi