Keyboard shortcuts for menus do not work on Windows
Follow-up on Native menu keyboard shortcuts #367 (Closed)
The NWJS MenuItem entry seems to promise that...
#!javascript
menu.append(new gui.MenuItem({
label: 'Quit'
, key: "X"
, modifiers: "ctrl"
, click : function () {
console.log('Todo: Quit')
}
})
... should show "Ctrl+X" as the shortcut, and that pressing ctrl+x should trigger the click action. This does not seem to be the case in nwjs-v0.12.3-win-x64.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
+1
This behavior is the same as on OS X, as far as I am aware. You've got a capital X. Pressing control+shift+x should trigger the action. (Pressing ^X will trigger the action, ^x will not.)
The shortcut does not display on Windows as noted in #367. Looks like that's issue #3694.
It works fine for me on Windows with nwjs-sdk-v0.25.0. Please try the latest nwjs build.
<script>
var menu = new nw.Menu({type: "menubar"});
var submenu = new nw.Menu();
submenu.append(new nw.MenuItem({
label: "Quit",
key: "X",
modifiers: "ctrl",
click: function() {
console.log("Todo: Quit")
},
}));
menu.append(new nw.MenuItem({
label: "test",
submenu: submenu
}))
nw.Window.get().menu = menu;
</script>

close until there is more information.