SFML community forums

Help => General => Topic started by: Alexander on January 10, 2020, 05:11:05 am

Title: Issues with Keyboard Input Monitoring after Updating to macOS Catalina
Post by: Alexander on January 10, 2020, 05:11:05 am
I recently upgraded to macOS Catalina (Version 10.15.2) and am now having issues with recognizing keyboard events. I am working in Xcode (Version 11.3) and receive the following error after building and running my project, and attempting to move a sprite with the arrow keys:

TCC deny IOHIDDeviceOpen
We got a keyboard without any keys (1)

If I go into 'System Preferences > Security & Privacy > Input Monitoring' and whitelist the .app that I build, it temporarily fixes the issue. But the second I change the source code and recompile, it stops recognizing keyboard inputs. Toggling the 'Input Monitoring' privileges fixes it for the current build, but this is annoying and I don't want to have to toggle this on and off every time I change the source code :-\

Has anyone else encountered this issue and/or found a solution?
Title: Re: Issues with Keyboard Input Monitoring after Updating to macOS Catalina
Post by: eXpl0it3r on January 11, 2020, 04:37:37 pm
If you actually use events (https://www.sfml-dev.org/tutorials/2.5/window-events.php) and not real-time input (sf::Keyboard::IsKeyPressed), then things should work fine.

For real-time input you will have to grant the app input monitoring privileges as far as I know, that's one of the major changes in Catalina for all applications.
There are ways to disable some stuff for developers, but as I am not a macOS user, I don't really know and would need to research myself.