Closed jb522185660 closed 7 years ago
You can only customise to ctrl-something without modifying the plugin source.
How can I do that?
The relevant code is below. Not sure how you’d set it to F5 though myself.
NSMenu *productMenu = [[[NSApp mainMenu] itemWithTitle:@"Product"] submenu];
if (productMenu) {
[productMenu addItem:[NSMenuItem separatorItem]];
struct { const char *item, *key; SEL action; } items[] = {
{"Injection Plugin", "", NULL},
{"Inject Source", [currentShortcut UTF8String], @selector(injectSource:)}
};
for ( int i=0 ; i<sizeof items/sizeof items[0] ; i++ ) {
menuItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithUTF8String:items[i].item]
action:items[i].action
keyEquivalent:[NSString stringWithUTF8String:items[i].key]];
[menuItem setKeyEquivalentModifierMask:NSControlKeyMask];
if ( i==0 )
[subMenuItem = menuItem setSubmenu:self.subMenu];
else
[menuItem setTarget:self];
[productMenu addItem:menuItem];
}
introItem.title = [NSString stringWithFormat:@"Injection v%s Intro", INJECTION_VERSION];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(workspaceDidChange:)
name:NSWindowDidBecomeKeyNotification object:nil];
}
else
[self error:@"InInjectionPlugin: Could not locate Product Menu."];
You might want to look at https://github.com/johnno1962/Refactorator/issues/4
OK,thank you !
And How can I hide the xcode right-top corner red 1?
Remove this line: [self.docTile performSelectorOnMainThread:@selector(setBadgeLabel:) withObject:@"1" waitUntilDone:NO];
I want to custome set the "ctrl+=: to "F5",how can I do that