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
Native menu keyboard shortcuts #367
Comments
+1 |
👍 |
+1 from me. Has any work been done on this as yet? |
On nativeThere are already libraries that do this kind of thing in javascript. However, if presented with a native node-webkit api, I would probably use it. |
Assigning the shortcuts isn't the issue. It's displaying the shortcuts in the menu bar that isn't possible (I believe) |
This would be a solid improvement |
+1 would be a really nice feature. |
+1 |
1 similar comment
+1 |
Hack solution: assign a keyboard shortcut through standard javascript. In the menu item label, manually type the associated keyboard shortcut yourself. Example: "file.append(new gui.MenuItem({label: "Open ⌘O"}));" You can add as many spaces between "Open" and "⌘O" as you need to make your menu items line up properly. You can copy and paste any of the following symbols if it helps: ⌘ ⇧ ⌥. |
I had to set <script src="script.js" charset="UTF-8"></script> |
@NodeGuy Does your document have |
@Mithgol No. I imagine that would work too. |
Well, Mousetrap.js works really well. |
I would like this native feature for node-webkit. Will make the app feel more native. |
For those using @rpmadden08's hacky solution, I wrote a script for generating menu labels with right aligned shortcuts: Just plug in your menu items in the code on the left and then copy the labels from the demo on the right. It uses hairspaces and thinspaces to get the alignment (almost) perfect. It also makes sure the '⌘' icons all line up even if you put another character (e.g. ⇧) in front. |
+1 |
+1 - This would great! Can this please be implemented. |
+1, Seriously considering this framework for our project, more features the better! |
This feature was released in 0.10.0. See the release notes: https://groups.google.com/d/msg/node-webkit/x7kYuDO0Cj8/cIxoJ6RFiLsJ So close this issue. If you have any suggestions or bug reports, please report new issue. Thanks. |
I am not sure about mac, but on windows if I specify: This does bind the ctrl-x sequence to this function. HOWEVER, it does not appear on the UI of the dropdown in my "Exit" menu item. It only displays "Exit", and not "Exit ctrl-x". This was the original request from pauliusuza. I don't believe this is resolved. |
@rogerwang Thanks for adding this! |
+1, this is not what OP requested. While the shortcuts work great, there is no UI support for them. |
+1 |
@TheTourer You should open a new issue about that; as @rogerwang said above,
And if (when) you open such new issue, please mention its number here. |
I would like to display the corresponding keyboard shortcut for an item menu, currently there is no method in native menu api to do this:
Proposed API should take into account 2 new optional parameters:
The text was updated successfully, but these errors were encountered: