nw.js icon indicating copy to clipboard operation
nw.js copied to clipboard

Keyboard shortcuts for menus do not work on Windows

Open blackslate opened this issue 11 years ago • 4 comments

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.

blackslate avatar Aug 13 '15 22:08 blackslate

+1

pedro-lucas avatar Aug 14 '15 18:08 pedro-lucas

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.

bleush38p avatar Aug 24 '15 01:08 bleush38p

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>

image

Christywl avatar Sep 14 '17 06:09 Christywl

close until there is more information.

Christywl avatar Oct 10 '17 06:10 Christywl