Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: MacOS 10.15 Keyboard Permissions  (Read 3556 times)

0 Members and 1 Guest are viewing this topic.

j.keller51

  • Newbie
  • *
  • Posts: 17
    • View Profile
MacOS 10.15 Keyboard Permissions
« on: October 31, 2019, 06:07:13 pm »
Hi,

My Mac computer recently updated to the new MacOS 10.15 Catalina. sf::Keyboard::isKeyPressed() no longer returns anything but false, and this error pops up in the console the first time I do a call to isKeyPressed() for a key:

Quote
2019-10-31 11:43:35.409526-0500 <appname>[63159:1973539] [default] 0x100017a54: TCC deny IOHIDDeviceOpen
We got a keyboard without any keys (1)

From a cursory google search, TCC deny IOHIDDeviceOpen is something other developers are seeing when their app tries to get global keyboard access (i.e. seeing key presses even when the app doesn't have focus). It seems that the app has to request keyboard permission if it wants this kind of access.

Is there a built-in window-based keyboard state check in SFML? For example, I'm still receiving keyPressed and keyReleased events, so I could implement my own keyboard class that uses these to update its own state, but this seems like something that should be in SFML already.

Thanks.
Jon

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: MacOS 10.15 Keyboard Permissions
« Reply #1 on: November 01, 2019, 05:02:01 pm »
isKeyPressed polls the actual hardware, this is an intentional design and there are currently no plans to change this to use events underneath.
On Catalina you'll now have to give access to the app to use your keyboard or you could build on top of events, as you suggested.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/