Preface: Before the understanding of the introduction of a foreign cool website, one of the sensitive website with the simultaneous holding "Q, A, p, l" to watch the video let go immediately force stop (manual squint). The actual use of this feature, I think it is possible to do some small system permissions control can be used, so as to eliminate the login and permissions-related functions.
Example 1: Increase permissions while holding "~, L, J, W," at the same time
1.1 JS section:
Key permissions Verify var iscrawler = false;//crawler rights var keybuf = {}; function KeyDown (e) { var evt = e | | window.event; Keybuf[evt.keycode] = true; Whatisdown (); } function KeyUp (e) { var evt = e | | window.event; Keybuf[evt.keycode] = false; Whatisdown (); } function KeyPress (e) { whatisdown (); } function Whatisdown () { var str = ""; if (keybuf[74] = = True && keybuf[76] = = True && keybuf[87] = = True && keybuf[192] = = True) { Console.log (' You opened the Authority '); Iscrawler = true;//Open Permission } for (k in keybuf) { if (keybuf[k] = = true) { str + k + ";"; } } }
1.2 HTML section:
<body onkeydown= "KeyDown" (event), "onkeyup=" KeyUp (event), "onkeypress=" KeyPress (event); >
Implements a JavaScript control keyboard that performs actions while pressing certain keys at the same time.