-1

One of my new application i need to disable window keys so,

Any one knows how to disable left and right window key in a node web kit application ?

Sandeep Ks
  • 504
  • 3
  • 13

2 Answers2

1

There's no such thing as disabling keys that I know of but what you can do is assign "nothing" (no function) to whichever keys you want to "disable" like this:

(Just paste this code at the very top of your javascript)

document.onkeydown=KeyPress;

function KeyPress(e){

e=e||window.event;

if (e.keyCode=='37'){} else // Left arrow do nothing

if (e.keyCode=='39'){} else // Right arrow do nothing

if (e.keyCode=='27'){} // Esc do nothing, and so forth.

}
SomeCoder
  • 11
  • 2
1

keyboard hooking is not possible with node js.you can create a low level keyboardhooking code in VC++ or c# and that run as a child process from nodewebkit

jack
  • 161
  • 1
  • 12