pynput keyboard listener does not detect keys on Mac OS X

前端 未结 5 1045
深忆病人
深忆病人 2021-01-21 19:36

I am using pynput to record keystrokes via Listener on OS X Mojave. I am using Pycharm as my IDE for running the code.

I was not able to get it to work using the same ex

5条回答
  •  星月不相逢
    2021-01-21 19:58

    Found the problem.

    For some strange reasons; OSX is uber-picky about returning events, so unless you go in the security settings and enable Pycharm to be in the list of apps that are allowed to use accessibility, it won't work.

    I didn't try on Windows yet, but I assume it will be the same issue. The only gripe I have is that I have no idea how to add Python itself to the list of supported accessibility apps; since the control panel does not allow me to go in /usr/local/bin, which is where I have Python3 installed (via Brew).

提交回复
热议问题