Код: Выделить всё
from pynput import keyboard
def on_activate_h():
print('++h pressed')
def on_activate_i():
print('++i pressed')
with keyboard.GlobalHotKeys({
'++h': on_activate_h,
'++i': on_activate_i}) as h:
h.join()
Код: Выделить всё
Unhandled exception in listener callback
Traceback (most recent call last):
File "/Users/name/workspace/julian/python-projects/python-keyboard/my-venv/lib/python3.13/site-packages/pynput/_util/__init__.py", line 229, in inner
return f(self, *args, **kwargs)
File "/Users/name/workspace/julian/python-projects/python-keyboard/my-venv/lib/python3.13/site-packages/pynput/_util/darwin.py", line 283, in _handler
self._handle(proxy, event_type, event, refcon)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '_thread._ThreadHandle' object is not callable
Подробнее здесь: https://stackoverflow.com/questions/791 ... r-callback
Мобильная версия