Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which API is behind the privacy feature "Input Monitoring" in the Security system preferences of macOS 10.15 Catalina?

In macOS 10.15 Catalina there is a new section in the Security system preferences called Input Monitoring.

It says:

Allow the apps below to monitor input from your keyboard even while using other apps.

I wonder which API is behind this to get apps into this this section.

I know AXIsProcessTrustedWithOptions(), which adds an app to the Accessibility section above Input Monitoring. Then I can use NSEvent.addGlobalMonitorForEvents(matching: .keyDown, handler: self.keyDown(event:)) to watch key presses from other apps. But what is Input Monitoring then good for?

It looks like adding an app to Input Monitoring manually doesn't allow you to use NSEvent.addGlobalMonitorForEvents(...).

Apps like Steam have been put into that section after updating to Catalina, so there has to be something that tells the system to put them there...

enter image description here

like image 489
Daniel Avatar asked Nov 02 '19 11:11

Daniel


People also ask

What is macOS Catalina and how does it protect you?

Save this story for later. MacOS Catalina is live and out now for the masses to download—and Apple being Apple, it's packed with features focused on user security and privacy. Here's how Catalina promises to make your Mac safer and better protected, from warnings about weak passwords to smart ways to retrieve a lost MacBook.

How does Red Hat 3scale API management work?

At the API gateway, Red Hat 3scale API Management decodes timestamped tokens that expire; checks that the client identification is valid; and confirms the signature using a public key. What is DevSecOps? If you want to take full advantage of the agility and responsiveness of DevOps, IT security must play a role in the full life cycle of your apps.

How secure is Catalina on safari?

Safari on both macOS and iOS has been pushing better password security for a while now, but with Catalina's arrival, the desktop browser will actively warn you if you sign into a site with a weak password-one that's short and simple enough to be easily cracked.

What's new in the macOS Catalina update?

The latest macOS update is chock-full of ways to better safeguard your data. Save this story for later. Save this story for later. MacOS Catalina is live and out now for the masses to download—and Apple being Apple, it's packed with features focused on user security and privacy.


1 Answers

@Nick Moore is right. This API is only available since 10.15.

There are two types of request for IOHIDRequestAccess(), and there is barely any doc about it :-( https://developer.apple.com/documentation/iokit/3181574-iohidrequestaccess?language=objc

if #available(macOS 10.15, *) {
    // below requests "Input Monitoring"
    IOHIDRequestAccess(kIOHIDRequestTypeListenEvent)
    // below requests "Accessibility"
    IOHIDRequestAccess(kIOHIDRequestTypePostEvent)
}
like image 199
xhg Avatar answered Sep 19 '22 08:09

xhg