RunJavaScriptOnKeyPress-Old_Version-

The old original version of RunJavaScriptOnKeyPress

View on GitHub

RunJavaScriptOnKeyPress-Old_Version-

The old original version of RunJavaScriptOnKeyPress

If you want here is the new version

Automatically generates a thing to run JavaScript on a specific key-press

Why I made this

I was tired of doing it myself

How do I use it?

If you want to use this just go here and follow the instructions

If there is a key you want to use like Caps Lock that doesn't show up when pressed this may be helpful

Updates

5.0 — This update adds pages that will generate JS for every letter (lower and upper case) and number key they can be accessed from the bottom of this page

4.0 — You can now use HTML5 in the JS

3.3 — Adds a reset button, will now remove any # above the one selected, can remove linked files

3.2 — Adds a Copy button and slight CSS3 changes

How do I put more then one on a page

If you want to use more then one on a page you will have to style it like this:

<script>
window.onkeypress = function(event) {
   if (event.keyCode == 56) {
// Your JS here
   }
   if (event.keyCode == 115) {
// Your JS here
   }
}
</script>

What kind of improvements are you planning on making?

Not sure yet

All the letters

If you want, the code for every letter can be found here