You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the recent addition of SRKeyCodeWithFlagsEqualToKeyEquivalentWithFlags, I've noticed that menu item validation is giving false-negatives with certain flags.
I have a menu item with a key equivalent of e, with no modifier flags 0. When I try to record a shortcut of ⌘e, the validator says it is taken by the same menu item.
How to reproduce:
Create a menu item with a key equivalent of e, no modifiers.
Create a SRRecorderControl that allows no modifier flags.
In the recorder delegate method -shortcutRecorder:canRecordShortcut: use a SRValidator to check if taken: [validator isKeyCode:keyCode andFlagsTaken:flags error:&error];.
Try recording ⌘e.
Here is an example of the errors that the validator returns:
2013-09-13 15:03:26.753 The key combination "E" can't be used because it's already used by the menu item "File➝Demo Item". 2013-09-13 15:03:27.888 The key combination "Command-E" can't be used because it's already used by the menu item "File➝Demo Item".
With the recent addition of
SRKeyCodeWithFlagsEqualToKeyEquivalentWithFlags
, I've noticed that menu item validation is giving false-negatives with certain flags.I have a menu item with a key equivalent of
e
, with no modifier flags0
. When I try to record a shortcut of⌘e
, the validator says it is taken by the same menu item.How to reproduce:
Create a menu item with a key equivalent of
e
, no modifiers.Create a SRRecorderControl that allows no modifier flags.
[recorder setAllowedModifierFlags:SRCocoaModifierFlagsMask requiredModifierFlags:0 allowsEmptyModifierFlags:YES];
In the recorder delegate method
-shortcutRecorder:canRecordShortcut:
use aSRValidator
to check if taken:[validator isKeyCode:keyCode andFlagsTaken:flags error:&error];
.Try recording
⌘e
.Here is an example of the errors that the validator returns:
2013-09-13 15:03:26.753 The key combination "E" can't be used because it's already used by the menu item "File➝Demo Item".
2013-09-13 15:03:27.888 The key combination "Command-E" can't be used because it's already used by the menu item "File➝Demo Item".
And here is an example project:
http://sublink.ca/clients/shortcutrecorder/ShortcutRecorderDemo.zip
The text was updated successfully, but these errors were encountered: