I have HTML5 app in which I use shortcut keys. In this app I have also chat. When I write in chat window then shortcut keys also fire up. How can I exclude shortcut keys in chat window?
This is how I use onkeydown
:
<body onkeydown="Gui.doKey(arguments[0] || window.event)">
Gui
:
var Gui = {
doKey: function (event) {
var key = event.keyCode || event.charCode;
switch (key) {
case 83: //s
skip();
break;
default:
console.log(key);
}
}
}