i have nsmenuitem has keyboard shortcut. set shortcut this:
// close let closeitem = nsmenuitem() closeitem.title = resources.quit closeitem.action = #selector(quit) closeitem.keyequivalentmodifiermask = [nscommandkeymask] closeitem.keyequivalent = "q" self.menu.additem(closeitem)
unfortunately, can not rid of "shift" key:
what problem code?
the solution pretty easy: instead of using "q", used "q" , shift modifier gone. new code:
self.menu.additem(nsmenuitem(title: resources.quit, action: #selector(quit), keyequivalent: "q"))
Comments
Post a Comment