Possible duplicate.
If you are allowed to use jquery, here is the answer you are looking for.
65 - ascii for 'A' and 97 for 'a' if you want to report to both.
$(function(){ $(document).keydown(function(objEvent) { if (objEvent.ctrlKey) { if ($(objEvent.target).not('input')){ if (objEvent.keyCode == 65 || objEvent.keyCode == 97) { objEvent.preventDefault(); } } } }); });
edit: modified based on your comment to allow input.
edit 2: if you enabled the jQuery user interface, you can use disableSelection () instead of disableTextSelect () otherwise try this.
edit 3: Sorry, disableSelection () is deprecated in jQuery 1.9, see here. . Try this simple hack instead of disableSelection (). replace objEvent.disableTextSelect(); on objEvent.preventDefault(); above.
edit 4: made a little cleaner.
source share