the parameter "onkeypress" specifies the function that handles the event of "keypress".
If you've not studied math , a function is a set of commands that are applied to an input to produce and output . In this case , we've said that if key pressed "over this image" , do the actions speicifed in imgKeyPressed function .
Now let's keep on creating our function , Here's the vbscript code :

and for your document (anything that is being shown in explorer window , of course when your keyboard cursor is not in a textbox , or your mouse has not clicked on any object , in this case you've got write the above script for that object) :