I'm looking for the Mac OS API that virtual machine or remote desktop type programs would use to "capture" the mouse and keyboard. That is to say, I want to write a GUI program where when the user clicks in my window, the normal mouse cursor disappears, and all keyboard and mouse input is diverted to my program, including global shortcuts like cmd-tab. What's the name of this API?
Asked
Active
Viewed 350 times
1 Answers
1
Found it: CGEventTapCreate can tap into the low level event stream to receive, filter, or insert HID events.

Lawrence D'Anna
- 2,998
- 2
- 22
- 25
-
Hello, could you use it to lock the mouse in your app? – Boiethios May 01 '23 at 19:32