1. Enter function name: .
  2. Enter desired key (and optional modifiers--control, alt, or shift). (Hint: You may set more than one key for the same function.)
  3. Copy the generated code into your document, following the existing scripts. If you get messed up, click Clear and try again.

This utility is very helpful in game controls, etc. (For a sample, type 9 or 0.)

If you had a game with dynamic control of a space ship (up, down, right, left), you could generate the function triggers for the functions like this.

up    = u
down  = n
right = j
left  = h
fire  = f

Type "up" into the function name. Type "u" into the key box. Repeat these steps with "down" and "n," right and j, left and h, and fire and f. You should finish with something like this:

<script type="text/javascript" src="keybindings.js"></script>
<script type="text/javascript">
sbindings = 'up=117 0 0 0;'
+ 'down=110 0 0 0;'
+ 'right=106 0 0 0;'
+ 'left=104 0 0 0;'
+ 'fire=102 0 0 0';
loadbindings();
</script>

Copy the script into your game. You will also have to download keybindings.js and upload it to your own site.

Presto! You're done.


Changes