Using DDHotKey wrapper for cocoa/carbon instantiate NSWindow -


with of dave delong , others on stackoverflow i've given tutorial app cool hotkey effect can't figure out how make instantiate window.

i have following setup:

a calculator not active when first run has nsstatusitem icon , menu, menu option opens main window.

also, have added ddhotkeycenter.h , ddhotkeycenter directory + linked carbon.framework.

the nsstatusmenu connected window through:

-(ibaction)activatemain:(id)sender{   [nsapp activateignoringotherapps:yes];} 

what wondering if it's possible connect actions fired hotkey, using blocks method, ibaction directly, or if there's intermediate step connect them?

would better have ddhotkey fire nsevent, or can that?

i seem bit confused it's implementation.

ddhotkey not "fire nsevent". invokes method on object. set hotkey fire activatemain: method of whatever object owns it:

... ddhotkeycenter * c = [[ddhotkeycenter alloc] init]; [c registerhotkeywithkeycode... target:self action:@selector(activatemain:) object:nil]; ... 

or if wanted use block, do:

... ddhotkeytask task = ^(nsevent *hkevent) {     [nsapp activateignoringotherapps:yes]; }; ddhotkeycenter * c = [[ddhotkeycenter alloc] init]; [c registerhotkeywithkeycode... task:task]; ... 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -