The Keypress event is triggered when a character is entered into a document. It does not represent the press of a key on the keyboard. The keydown represents the pressing of a key on the keyboard, and the keyup represents the release of a key on the keyboard. These events represent the character entered by it's keyboard key code, while the key press represents it by the code of the generated character. Form Elements Keypress (ALT+KEY) <input type="button" name="x" value="x" accesskey="b" />' -------------------------------------------------------------------------------- Firefox..: e.keyCode Explorer.: event.keyCode // if IE, make e window.event like firefox if(document.all|window.event) e = window.event -------------------------------------------------------------------------------- Code Example function app_onkey(e) { if(document.all) { //(window.event) firefox uses "e" already... e = window.event } //alert(e.keyCode); return(0) var key = e.keyCode var ALT = e.altKey var CTRL = e.ctrlKey if(ALT) return(altkey(e)) var kA = 65 var kD = 68 var kG = 71 var kS = 83 if(key==kA) return(xend()) if(key==kS) return(xbeg()) if(key==kD) return(xdef()) if(key==kG) return(xusr()) return(1) } window.document.onkeyup = app_onkey //window.document.onkeydown = app_onkey //window.document.onerror = null function altkey(e) { var key = e.keyCode var k1 = 49 var kk = APP_PARA_K2.split(',') for(var i=0;i<kk.length;i++) if(key==k1+i) return(xalt(i+1)) return(0) } -------------------------------------------------------------------------------- Bubble Cancellation by Code: var APP_DOC_KEY = 1 //global variable onkeyfnc { if(!APP_DOC_KEY) { APP_DOC_KEY = 1 return(0) } ...keypress code } form: <input type="text" onkeypress="APP_DOC_KEY=0" />