I want to create a replacement for the app switcher (aka 'cmd + tab').
I know that it's possible because Lite Switch X does it.
What I've got achieved so far:
By force quitting the dock and calling CPSRegisterForKey()
(which is a private API function) I can prevent the default cmd+tab from working.
The second step is two register the hot key for my app. The standard way of doing this, RegisterEventHotKey()
, doesn't work. A bit of googling and GDBing suggests that the Dock and Lite Switch X use CGSSetHotKeyEnabled()
and CGSSetHotKey()
(both of these are private API functions). The problem I have is that I do not know what arguments these functions take.
How can I determine the arguments for a private API function?
Update:
I've got a little further with CGSSetHotKey()
:
OSErr setupResult = CGSSetHotKey(_CGSDefaultConnection(), unknownArg, unknownArg, unknownArg, kCGEventFlagMaskCommand, ???, ???, ...);