Sha256: 880485ae070beb71f483156d7fefa91ec77827996a59227bdc2ebda397c9c2ca
Contents?: true
Size: 882 Bytes
Versions: 10
Compression:
Stored size: 882 Bytes
Contents
<!doctype HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Keys fixture</title> </head> <body> <h1>Keys test</h1> <pre id="log"></pre> <script type="text/javascript"> logEl = document.getElementById("log"); function handler(e) { e.preventDefault(); var modifiers = [] if (e.altKey) modifiers.push('alt'); if (e.ctrlKey) modifiers.push('ctrl'); if (e.metaKey) modifiers.push('meta'); if (e.shiftKey) modifiers.push('shift'); logEl.innerHTML = logEl.innerHTML + [ e.type.substr(3), e.keyCode, (e.keyCode >= 32) ? String.fromCharCode(e.keyCode) : "", modifiers ].join(", ") + "\n"; console.log(e); } document.addEventListener('keydown', handler, false); document.addEventListener('keyup', handler, false); document.addEventListener('keypress', handler, false); </script> </body> </html>
Version data entries
10 entries across 10 versions & 1 rubygems