Bug in setKeyEquivalentMask:?
Bug in setKeyEquivalentMask:?
- Subject: Bug in setKeyEquivalentMask:?
- From: "Bell, Carl" <email@hidden>
- Date: Tue, 6 Nov 2001 09:31:12 -0600
- Thread-topic: Bug in setKeyEquivalentMask:?
Howdy,
I am trying to modify the key equivalents (actually, the modifier keys)
for two menus at runtime. Depending on a user setting, I want to be
able to use cmd-N and shift-cmd-N to create new default and secondary
document types. I'm using
[aMenuItem setKeyEquivalentMask:NSCommandKeyMask]
to set it to cmd-N and
[aMenuItem setKeyEquivalentMask:(NSCommandKeyMask|NSShiftKeyMask)]
to set it to shift-cmd-N.
One thing I've noticed is that if the shift key modifier is set for a
menu in IB, it "sticks" and the first line above doesn't set it to just
cmd. If I don't specify the shift key in IB, i.e., set both menu items
to cmd-N, it works just fine. Also, when I tried other modifier keys,
it worked. It seems that it's just the shift key.
Am I doing this right, or is the shift key special, or is this a bug? To
work around this I can just set both menus to cmd-N in IB.
-cb
________________________________________________________________________
Carl W. Bell <
http://www.baylor.edu/~Carl_Bell/index.html>
Sr. Analyst/Programmer Baylor University Academic Technology Center