取得按鍵輸入
發表於 : 2009-12-16 23:08:51
function check_keycode(keyasc){
//大寫 65-90 小寫 97-122
if(keyasc>=65 && keyasc<=126){
openwin(keyasc);
}
}
if (navigator.appName=='Microsoft Internet Explorer') {
document.onkeydown = function() { return check_keycode(event.keyCode); }
}else {
document.onkeypress = function(e) { return check_keycode(e.which); }
}
//大寫 65-90 小寫 97-122
if(keyasc>=65 && keyasc<=126){
openwin(keyasc);
}
}
if (navigator.appName=='Microsoft Internet Explorer') {
document.onkeydown = function() { return check_keycode(event.keyCode); }
}else {
document.onkeypress = function(e) { return check_keycode(e.which); }
}