Q: How to stop CTRL + keys affecting browser when using keypress events on page? I am incorporating onkeyup and onkeydown events into my page.
I want to be able to use Ctrl + A, B, C, D... keypresses (right way through the alphabet).
This is fine, but whilst my page reacts to these key presses, so does the browser as these are browser shortcuts.
Is there any way to block the shortcuts on the page? 

A: event.preventDefault(); prevents default event action when key is pressed.
If you need help with key codes, look at http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes.

A: Just use the jquery.hotkeys this plugin will do everything for you.

jQuery Hotkeys is a plug-in that lets you easily add and remove handlers for keyboard events anywhere in your code supporting almost any key combination.


A: If you are using jQuery, you can take a look into https://github.com/jeresig/jquery.hotkeys
I used it a while back and found it very good.
