Posted by: iamipew | กุมภาพันธ์ 6, 2008

JavaScript Window Event OnKeydown

document.onkeydown = function(){

if(window.event && window.event.keyCode == 116) { // Capture and remap F5
window.event.keyCode = 505;
}
if(window.event && window.event.keyCode == 91) { // Capture and remap F5
alert(‘Window key was pressed’);
return false;
}
if(window.event && window.event.keyCode == 505) { // New action for F5
alert(‘F5 key was pressed!’);
return false;
}
if(window.event && window.event.keyCode == 13) { // New action for Enter
alert(‘Enter key was pressed!’);
return false;
}
if(window.event && window.event.keyCode ==114){ // F3, do something then cancel
alert(‘F3 key was pressed!’);
return cancel();
}
if(window.event && window.event.keyCode ==122){ // F11, do something then cancel
alert(‘F11 key was pressed!’);
return cancel();
}
function cancel(){
event.cancelBubble=true;
event.keyCode=0;
return false
}
/* if(window.event.shiftKey){
alert(“shiftKey was pressed!”);
return false;
}
*/
}


Responses

  1. A friend to buy wow goldTo wow power leveling?On the world’s most concessions to the most reputable sites under the single!

  2. To the global wow gold the cheapest wow power leveling under the cheapest single-site! -5249791315947

  3. Hi,Do you need advertising displays, digital signages, advertising player and LCD displays? Please go Here:www.amberdigital.com.hk(Amberdigital).we have explored and developed the international market with professionalism. We have built a widespread marketing network, and set up a capable management team dedicated to provide beyond-expectation services to our customers.
    amberdigital Contact Us
    website:www.amberdigital.com.hk
    alibaba:amberdigital.en.alibaba.com[fchabbjcfdbbbh]


ใส่ความเห็น

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / เปลี่ยนแปลง )

Twitter picture

You are commenting using your Twitter account. Log Out / เปลี่ยนแปลง )

Facebook photo

You are commenting using your Facebook account. Log Out / เปลี่ยนแปลง )

Google+ photo

You are commenting using your Google+ account. Log Out / เปลี่ยนแปลง )

Connecting to %s

หมวดหมู่

%d bloggers like this: