Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS deployment requires administrator rights #54

Open
andreped opened this issue Apr 7, 2023 · 5 comments
Open

macOS deployment requires administrator rights #54

andreped opened this issue Apr 7, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@andreped
Copy link
Owner

andreped commented Apr 7, 2023

Quite annoyingly, the keyboard library requires sudo rights in order to be used on macOS.

If this is not done, you will get this error message.

The alternatively is to run the script like so: sudo python deploy.py

Even still, now with sudo the program might fail to find the dependencies (observed on macOS).

Nonetheless, this is bad practice. We should not need sudo permissions to deploy the software. We need to find a way to enable keyboard events on macOS (all UNIX-based systems likely have the same issue, e.g., Ubuntu).

@andreped andreped added the bug Something isn't working label Apr 7, 2023
@andreped
Copy link
Owner Author

andreped commented Apr 7, 2023

Could try replacing it with pynput (see here). However, I feel I have tried this before and it did not work.

@andreped
Copy link
Owner Author

andreped commented Apr 7, 2023

Using pynput runs into zsh: illegal hardware instruction and crashes the program when attempting to listen for keyboard events. Might be that it also requires sudo rights?

@andreped
Copy link
Owner Author

andreped commented Apr 7, 2023

According to the documentations, pynput does also require sudo permissions to run (see here). However, on macOS, if you bundle the program as a python package you can whitelist the program when running it.

This is a valid alternative, however, it would be much better to avoid it altogether.

@andreped
Copy link
Owner Author

After removing the keyboard listeners and events, I got a new error which is solely fixed in 909e264.

After that, I reach the same issue as for Windows. Hence, keyboard events definitely require handling.

An idea I had was to build a very simple GUI for the software and save it as an application. That way in the macOS security settings one could whitelist the program to allow keyboard events.

@andreped
Copy link
Owner Author

Added disclaimer regarding this to the REAME, see dd884ed

@andreped andreped reopened this Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant