1

Using the Synopsis snippet from https://github.com/nwjs/nw.js/wiki/Shortcut, The global hotkey works as expected. Modifying the key as follows:

key : "Ctrl+Alt+Z" works as expected.
key : "Ctrl+Alt+Space" does nothing.
key : "Ctrl+Alt+ " does nothing.
key : "Ctrl+Alt+"+String.fromCharCode(32) does nothing.

There is no failure reported when the key is registered or when struck by the user.

Using another modifier, only Ctrl, for example produces similar results; All combinations work as expected unless a space is included.

I'm working on a Mac with OS X Yosemite, where "Ctrl+Alt+Space" normally opens the Spotlight search window. I have reassigned that function to a different key sequence so that "Ctrl+Alt+Space" does nothing before starting my nw.js program.

nw.js 0.11.6
node-webkit-builder 1.0.8

App run with command

nwbuild -v 0.11.6 -r .

Also fails when built as an app

nwbuild --quiet -v 0.11.6 -p "osx64" .

Apparently nw.js (formerly Node-Webkit) does not support the space character in global hot keys.

Any workaround or just confirmation would be appreciated.

gihrig
  • 51
  • 1
  • 10
  • If you look at the [shortcut.key](https://github.com/nwjs/nw.js/wiki/Shortcut#shortcutkey) reference, it doesn't look like space is supported. – Ben Fortune Jan 30 '15 at 09:47
  • @Ben Fortune: Point taken. I was hoping that was an oversight in the docs, and there was some trick I had mised. Examining the source https://github.com/nwjs/nw.js/search?utf8=%E2%9C%93&q=comma&type=Code reveals no specific support for alpha keys such as 'Q', apparently because character keys are covered in some default way?, if so, this should include the 'space' character. However, the 'comma' character (and some others) have key constants. I'll file an enhancement request. – gihrig Jan 30 '15 at 18:52
  • I opened an issue with the nw.js project https://github.com/nwjs/nw.js/issues/3034 – gihrig Jan 30 '15 at 23:31
  • Although it will not work as a global hotkey, [Mousetrap.js](http://craig.is/killing/mice) is a pretty handy tool for keyboard shortcuts in Node.js. It will only work when the application is active, but it does work. – JaredCubilla Mar 02 '15 at 01:56
  • Use Jquery in 'body' – Fernando Vellozo Apr 06 '15 at 02:44

0 Answers0