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
sf::WindowBase::pollEvent
triggers input monitoring prompt on macOS even though it's not needed
#2843
Comments
I ran the Island example which doesn't use |
Often mentioned in the Discord is avoiding |
@Bambo-Borris The issue here is that the permission is triggered on |
@ChrisThrasher Well this was very useful.
The latter creates the |
Prerequisite Checklist
Describe your issue here
As I understand, input monitoring permission is required when using
sf::Keyboard::isKeyPressed
since checking for key press makes possible to create a keylogger, however when just watching for events delivered to the process looking forsf::Event::KeyPressed
events, no permission is needed.I'm not familiar with SFML but by checking around with the code I believe that the permission prompt is triggered here and the function involved is IOHIDManagerCopyDevices. If I simply uncomment
HIDInputManager::initializeKeyboard
here and recompile SFML I can run the minimal example with no permission prompt.Perhaps the keyboard should not be initialized when receiving keyboard events? As it stands, it's bad UX to open an app or game and seeing a spurious prompt requesting eavesdropping capabilities for no apparent reason as soon as a key is pressed, all while keyboard input works anyway.
Your Environment
Steps to reproduce
Expected behavior
The window just closes.
Actual behavior
The window closes, but macOS prompts to grant input monitoring permission for the app (or Terminal in this case).
The text was updated successfully, but these errors were encountered: