Pynput Keyboard Listener Does Not Detect Keys On Mac OS X
Solution 1:
This is probably a bit late, but the answer is to go into:
- Settings ->
Security & Privacy
- Click on the
Privacy
tab - Click the
+
Hold downCMD
+SHIFT
+.
(so that you can see hidden files/folders) - Navigate to
/usr/local/bin
or wherever you have Python installed - Click
okay
.
That should do it.
Note
If you try to run your app via the terminal, you will need to add the terminal.app to the list of allowed apps, as done above for Python.
Solution 2:
This is probably a bit late too, but the simple answer is to go into:
- Preference
- Security & Privacy
- Input Monitoring -> confirm PyCharm
Solution 3:
Some people have stated that adding IDLE to supported accessibility apps is what allows python itself to run the listener.
while your in a finder window, if you press cmd+shft+'.' (period key) it will show hidden files, which will allow you to navigate to usr/local/bin and look for your python implementation.
On windows this is slightly different, I always run python/pycharm as admin and it never gives me any issues.
Solution 4:
Try superuser ($sudo su) and run your python code in terminal, I think it should work
Im was working with OSX 10.12 and pynput was only getting cmd ctrl fn and option keys when pressed but now in superuser it gets the keys.
Post a Comment for "Pynput Keyboard Listener Does Not Detect Keys On Mac OS X"