Open mseifrid opened 2 years ago
Just found this same issue on macOS Ventura 13.1, python 3.11, pynput 1.7.6.
Just modifying the HotKey example in the docs to add suppress = True
causes it to fail silently.
Trying to add a darwin_intercept
function as mentioned in the FAQ causes the same silent failure.
from pynput import keyboard
def on_activate():
print('Global hotkey activated!')
def for_canonical(f):
return lambda k: f(l.canonical(k))
hotkey = keyboard.HotKey(
keyboard.HotKey.parse('<cmd>+h'),
on_activate)
with keyboard.Listener(
on_press=for_canonical(hotkey.press),
on_release=for_canonical(hotkey.release),
suppress=True # <------ causes example to fail silently
) as l:
l.join()
Description
suppress=True
results in the Listener running through the code in the context manager, but won't give time for any inputs. Seems to work fine on Windows 10 and Ubuntu 20.04.Platform and pynput version OS: macOS 11.6.5 Python: 3.9 pynput: 1.7.6
To Reproduce