Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

left key capture

Status
Not open for further replies.

russland

Programmer
Jan 9, 2003
315
CH
short quest. how can i capture the left and right arrow key? any clue?

cheers
brayan
 
try this:
<input type=&quot;text&quot; onkeypress=&quot;alert(event.keyCode())&quot;>

Known is handfull, Unknown is worldfull
 
DID YOU VERIFY BEFORE YOU ANSWERED? i don't think so.

cheers anyway
 
Try this:
save the codes to an .htm file, then open it in your browser.
Code:
<form>
<input type=&quot;text&quot; onkeyup=&quot;javascript:alert(window.event.keyCode)&quot;> </form>

You will notice that the value of the &quot;Left Arrow&quot; is 37 and &quot;Right Arrow&quot; is 39.
 
oops that () must have been extra. i have used the keyCode event for creating a context sensitive help for one of my web sites... :)

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top