moses-palmer / pynput

Sends virtual input commands
GNU Lesser General Public License v3.0
1.79k stars 248 forks source link

uinput backend: Error pressing Key.alt #430

Closed linux-man closed 2 years ago

linux-man commented 2 years ago

Description

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/home/joao/keys/pynput/_util/__init__.py", line 210, in run
    self._run()
  File "/home/joao/keys/pynput/_util/uinput.py", line 55, in _run
    self._handle(event)
  File "/home/joao/keys/pynput/keyboard/_uinput.py", line 425, in _handle
    key = self._layout.for_vk(vk, self._modifiers)
  File "/home/joao/keys/pynput/keyboard/_uinput.py", line 228, in for_vk
    raise ValueError(modifiers)
ValueError: {<Key.alt: <56>>}

Platform and pynput version Linux Mint 20.2, last pynput (12/12/21) running uinput backend.

To Reproduce Press left Alt key.

moses-palmer commented 2 years ago

Thank you for your report.

This certainly seems like an omission. I have pushed fixes to the master branch. They will be included in the next release.