Key press

We can read which key is pressed by user by reading window event. We need to use onkeydown to get arrow keys status. Here is the sample code to read key press
<script language='JavaScript' type='text/JavaScript'>
document.onkeypress = function(key_dtl) {
 key_dtl = key_dtl || window.event; 
var uni_code = key_dtl.keyCode || key_dtl.which; 
var key_name = String.fromCharCode(uni_code); 
Visitors Rating
Your Rating

Post Comment This is for short comments only. Use the forum for more discussions.

HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2019 All rights reserved worldwide Privacy Policy Disclaimer