Is it possible to have keyboard event listener canvas.addEventListener('onkeydown', ev_keydown, false); like we have Mouse event Listeners
canvas.removeEventListener('mousedown', ev_mousedown, false);
canvas.addEventListener('mousedown', ev_mousedown, false);
in JavaScript.
If not then what would be the alternate?
jQuery offers a simple way to bind eventlisteners to DOMElements
and there are also eventlisteners for keyboard events here are some links
http://api.jquery.com/keydown/
http://api.jquery.com/keypress/
http://api.jquery.com/keyup/
you can bind them to window and this should do what you want
you can also use your own method to bind events in a cross-browser compatible way
this should also allow you to bind the mentioned types of events