0

I have this code, but I cannot make it work. Or thru jQuery I just cant do that?

    $(document).keyup(function(e) {
      if(e.which == 44) {
        alert("11");
        e.preventDefault();
      }
    });
Jaroslav Štreit
  • 397
  • 4
  • 16
  • 1
    You can prevent the event from bubbling up the DOM, but you *can't* prevent the browser from giving it to the windowing system! At least not in chrome. Not posting this as an answer as i cannot find any supporting docs. – techfoobar May 27 '13 at 16:48
  • Thank´s, so it´s not possible... – Jaroslav Štreit May 27 '13 at 16:53
  • Yes, pretty sure about it. You may be able to get it working in a broken browser, but my advice is to avoid banking on it. – techfoobar May 27 '13 at 16:54
  • 1
    You should see [***this Q&A***](http://stackoverflow.com/questions/3130983/stop-user-from-using-print-scrn-printscreen-key-of-the-keyboard-for-any-we) – SpYk3HH May 27 '13 at 17:10

0 Answers0