1

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, ???, ???, ...);

4

1 回答 1

1

您是否尝试过使用class-dump?它通常很有帮助。

于 2010-06-18T17:14:35.747 回答