javascript - Jquery, Disable Browser Shortcut keys -


I'm trying to block some browser shortcut keys for my projects like if the user presses the F1 key The new page should open the project, but browse to its help page Browse if I press Ctrl + N then it should open a specific page but open the browser in a new window.

Here my code is I ( )

  $ ('body'). Keypress (function) {if (event.keyCode == 17 & amp; amp; amp; and event.keyCode == 110} {warning ("new");} and {event.preventDefault ();} }); It seems that you can not interfere with ctrl + key combinations, for which special words can be used.  

Browser (at least it looks like Chrome 34's status).

Take a look at some ways to show keys and key combinations. Note that when pressing ctrl + n , the keydown handler still triggers state transit (observation of alerts on keystroke sequence ctrl + n , shift + n Proof of this is , shift + n ).

However, I have not found a way to stop the browser from claiming keystrokes with meaning in the UI (which I believe is

edit :

I got a warning on Chrome (Warning: I have not tested the problem of the problem, the current version of Chrome).


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -