-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
nw2 regression: CMD + 1-9 shortcuts not working on OSX when using nw2 mode (disabling nw2 makes it work as it should) #7943
Comments
@sysrage could you confirm that it's not working? |
I can confirm the example code fails to detect when Command+1 is pressed. It correctly detects Command+Shift+1 and Command+B, but not Command+1. This appears to have been broken since version 0.42.4. Works: 0.35.0, 0.40.0, 0.42.0, 0.42.3 |
@rogerwang this is apparently a nw2 issue only. Please see comments and updated description. |
I just realized this may be because I disabled nw2. Will test and report. Reopening... |
Indeed. Reenabling nw2 in any version post 0.42.3 (up until 0.70.1 that is the latest currently available) CMD+(1-9) does not work. When one disables nw2, it works just fine. |
Issue Type
Before opening an issue, please search and see if it has already been raised.
Bug Report
Feature Request
Successfully reproduced against the latest version of NW.js?
Current/Missing Behavior
Creating a menu shortcut in any code on a Mac that uses CMD + 1-9 keys shows properly in the menu, but cannot be triggered from 0.59 onward, including the latest version. Last time it did work was 0.28.3. CMD + 0 (zero) works, as does any other key combination (including CMD + SHIFT + 1-9). Below is edited excerpt from the group email (available at https://mail.google.com/mail/u/0/#search/nwjs/FMfcgzGqPpkjwsqVJGbdlxXNkkTjBDfh):
I have a software project that has nw.js OSX menu shortcuts for select options set to CMD+1 through CMD+5. Up until 0.42.3 these shortcuts worked just fine. However on newer versions (I tried 0.59, 0.62, and all the way up to the latest 0.70.1) this shortcut does not register at all, but only on OSX (I am using 10.14.6 and also tried 11.7). The same appears to have been reported by other users of my software. Please note the same is impossible to test on other OSs (AFAICT) because Win+1 (or Ubuntu key + 1) key is intercepted by the OS and triggers an OS action.
Curiously, if I set the shortcut to CMD+Shift+1, it works, but CMD+1 alone does not. So, out of all the number keys only 0 works. CMD + 1-9 do not (same behavior as above). All other keys (letters) work fine with CMD+ (or any other combination of modifiers), on any OS.
This is true for both built-in laptop (MBP) keyboard, and an external (USB) full-size keyboard.
As I mentioned, no code has been changed in the software project and this works fine on 0.28.3 and up until 0.42.3, but not on anything newer. This is directly related to enabling nw2 by default. UPDATE: running any newer version with disabling nw2 flag makes shortcuts work again. So, this is a nw2 bug.
On Windows and Linux the same project uses Ctrl key and there it all works as it should on all versions of nw.js. I am unable to test the same on Windows and Linux since both have other system things mapped to CMD + 1 and other number keys.
Expected/Proposed Behavior
CMD + 1-9 should trigger the menu item with the associated shortcut.
Additional Info
package.json
index.html
Note that this may have some similarity with two stale issues reported earlier #7440 and #7463 but it is not the same.
The text was updated successfully, but these errors were encountered: