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
Post a Comment