Skip to content
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

[mac] Native Keyboard Shortcuts #1670

Closed
wants to merge 1 commit into from

Conversation

FWeinb
Copy link
Contributor

@FWeinb FWeinb commented Mar 7, 2014

As described in Issue #367, added basic keyboard shortcut handeling to MenuItems on OS X.

Usage:

new gui.MenuItem({
   label: 'Test 1',
   shortcut : '\u0008', //  ⌘⌫ 
   click: function() {
     alert(this.label);
   }
});

The shortcut option will be directly used as a keyEquivalent thus will allow everything described here:

This method considers the case of the letter passed to determine if it has a Shift modifier added. That is, [item setKeyEquivalent:@"w"] sets the key equivalent to ⌘W, while [item setKeyEquivalent:@"W"] is ⌘⇧W.
[...]
If you want to specify the Backspace key as the key equivalent for a menu item, use a single character string with NSBackspaceCharacter (defined in NSText.h as 0x08) and for the Forward Delete key, use NSDeleteCharacter (defined in NSText.h as 0x7F). Note that these are not the same characters you get from an NSEvent key-down event when pressing those keys.

With this API is not possible to define a custom KeyEquivalentModifierMask.

@rogerwang
Copy link
Member

Thanks. But please see this thread first: https://groups.google.com/d/msg/node-webkit/W261vvrL2jo/971SfZ7Z7eQJ

@FWeinb
Copy link
Contributor Author

FWeinb commented Mar 24, 2014

Is this still in development? The last post there dates back to 27.06.2013.

@rogerwang
Copy link
Member

@FWeinb yes it's still in development.

@quasado
Copy link

quasado commented Mar 30, 2014

When will this stuff be available? We'd be in urgent need of keyboard shortcuts as well ..

@rogerwang
Copy link
Member

@quasado it should be in 0.9.3 but currently there is no schedule for it.

@rogerwang
Copy link
Member

This has been available from v0.10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants