swift - Can not get rid of Shift-Key in NSMenuItem Modifier Mask -


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:

result

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