-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SRValidator doesn't catch NSMenuItem shortcuts that involve arrow keys #20
Comments
@gcox Interesting. I've checked with ShortcutRecorderDemo. If you set item's shortcut to e.g. cmd-left_arrow and then try to set any other shortcut to this value, app will show a warning. Could you reproduce this problem with this demo? |
@Kentzo Sure. The problem is when you use interface builder to record the key equivalent for a menu item.
No warning is displayed. If you NSLog the keyEquivalent for the new menu item and the keyEquivalent for the shortcut recorded by ShortcutRecorder, you'll see they do not match. |
@gcox Hmm, probably found an interesting bug. |
@gcox Ok, I found some other issues with checking other special keys. Will push fix in 1-2 days. |
- Introduce new method that encapsulate all keycode/key equivalent comparison - Take into account modifier flags - Separate logic of Explicit and Implicit modifier flags
@gcox Pushed fixes. Please take a look. |
@gcox Any chance you've taken a look at the develop branch? |
@Kentzo Sorry, I have looked at the diff but I haven't had time to pull this down and play around with it. I should have some time tonight though. |
@gcox Thanks. |
@Kentzo I pulled the code from the develop branch into the demo application and the same core issue that I initially reported seems to be unchanged. Creating a shortcut that involves an arrow key for a menu item, using interface builder's own shortcut recorder control, does not get caught by the validator when using the demo to record a shortcut. |
Thanks for your help @gcox. Are you trying to set it with or without modifier flags? What is your system language layout? Best regards, Ilya Kulakov 23.08.2013, â 10:58, George notifications@github.com íàïèñàë(à):
|
Double checked, that works for me. Could you archive and upload your version of the demo so I can check it? Best regards, Ilya Kulakov 23.08.2013, â 10:58, George notifications@github.com íàïèñàë(à):
|
The shortcut I'm using is CMD+Right Arrow Here's an archive of the demo app: |
You set key equivalent of the "Ping" menu item, not "Item". Just set key equivalent for a proper item ("Item") and try test again. On 23.08.2013, at 17:41, George notifications@github.com wrote:
|
Ahhh, I'm an idiot:) You're right, will confirm when I get home. |
@Kentzo Confirmed this is working correctly |
When using SRValidator to validate a shortcut by testing an NSMenu to see if the shortcut is taken, it fails to detect that an NSMenuItem is using a shortcut involving an arrow key.
If I change lines 128-131 of SRKeyCodeTransformer.m to pass NS_ArrowFunctionKey instead of SRKeyCodeGlyph_Arrow, the problem is resolved and SRRecorderControl still displays the user friendly rendering of the arrow key characters. I didn't submit a pull request b/c I'm not sure yet if this has any negative effects in the library.
The text was updated successfully, but these errors were encountered: