pynput keyboard listener does not detect keys on Mac OS X

前端 未结 5 1042
深忆病人
深忆病人 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:42

    This is probably a bit late, but the answer is to go into:

    1. Settings -> Security & Privacy
    2. Click on the Privacy tab
    3. Click the + Hold down CMD + SHIFT + . (so that you can see hidden files/folders)
    4. Navigate to /usr/local/bin or wherever you have Python installed
    5. 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.

提交回复
热议问题