You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a keyboard shortcut is registered via the Shortcut API e.g.
'ctrl+shift+c'
and somewhere on the DOM a listener for 'keydown' is registered ( by using jQuery on(...) )
el.on('keydown', function (e) {
console.log('you pressed ' + e.which + ' with modifiers');
if (e.ctrlKey) {
console.log('ctrl');
}
if (e.altKey) {
console.log('alt');
}
if (e.metaKey) {
console.log('meta');
}
if (e.shiftKey) {
console.log('shift');
}
});
this event listener will not fire for the key combo ctrl+shift+c even if the focus is on the element where the listener is registered. The node-webkit shortcut listener will execute just fine.
So the event is somehow swallowed by Node-Webkit. Is this on purpose? Can this be fixed easily? If anybody can point me in a direction I will happily try to fix this myself and supply a pull request.
The text was updated successfully, but these errors were encountered:
If I understand correctly, you have registered a global keyboard shortcut for "ctrl+shift+c" and afterwards try to listen for the same key-combination on a DOM element.
This is not a nw.js issue, but probably working as intented by the operating system. It would be confusing to the user, if pressing "ctrl+shift+c" had two separate effects, one of them depending on which window has the focus...
Try registering a globale shortcut for e.g. "c" (without modifier keys). Then enter a shell or a text editor and type "c". I've tried that on Linux and I was not able to type "c" anywhere until exiting nw.js. The same happens for every other program that registeres global shortcuts (e.g. Kupfer or Synapse)
If a keyboard shortcut is registered via the Shortcut API e.g.
and somewhere on the DOM a listener for 'keydown' is registered ( by using jQuery on(...) )
this event listener will not fire for the key combo ctrl+shift+c even if the focus is on the element where the listener is registered. The node-webkit shortcut listener will execute just fine.
So the event is somehow swallowed by Node-Webkit. Is this on purpose? Can this be fixed easily? If anybody can point me in a direction I will happily try to fix this myself and supply a pull request.
The text was updated successfully, but these errors were encountered: