开发者

Global Hotkey eventNotHandledErr Pass to Event Handler

开发者 https://www.devze.com 2023-02-14 13:20 出处:网络
I\'ve pored through most of the posts regarding the creation of Global Hotkeys using Carbon. Is it possible in the hot key handler function to return eventNotHandledErr and have the event passed on to

I've pored through most of the posts regarding the creation of Global Hotkeys using Carbon. Is it possible in the hot key handler function to return eventNotHandledErr and have the event passed on to the next handler? Here's some pseudocode:

OSStatus myHotKeyHandler(EventHandlerCallRef nextHandler, EventRef anEvent, void *userData)
{   
    OSStatus result;

开发者_Go百科    if ( appX is running || appY is running ) { 
        [(MyAppController *) userData doSomething];
        result = noErr;
    } else {
        result = eventNotHandledErr;    
    }

    return result;
}

In the event that I'm not in application X or Y, I want to be able to pass the event on. Is this possible?

I know I can set up a notification for application switched events, but that requires Enable access for assistive devices to be turned on. If there's a way to pass the event to the next handler, that would be great.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号