Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-21-2002, 09:25 PM   PM User | #1
Alias
New Coder

 
Join Date: Jun 2002
Location: EUROPE
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Alias is an unknown quantity at this point
Ctrl+R ?

How to disable pressing of keyboard shortcut Ctrl+R ?

User is in occasion to refresh page with RIGHT CLICK -> REFRESH,
but I need to disable pressing of keys Ctrl+R.


Possible?

Regards
Alias is offline   Reply With Quote
Old 06-21-2002, 09:44 PM   PM User | #2
x_goose_x
Regular Coder

 
Join Date: Jun 2002
Location: Montreal, Canada
Posts: 644
Thanks: 0
Thanked 0 Times in 0 Posts
x_goose_x is an unknown quantity at this point
Don't forget about F5.
x_goose_x is offline   Reply With Quote
Old 06-21-2002, 10:50 PM   PM User | #3
jkd
Senior Coder

 
jkd's Avatar
 
Join Date: May 2002
Location: metro DC
Posts: 3,163
Thanks: 1
Thanked 18 Times in 18 Posts
jkd will become famous soon enough
Quote:
Originally posted by x_goose_x
Don't forget about F5.
Bah, only for Windows users.

Personally, I dislike any site which attempts to disable any keyboard or mouse action related to the GUI.

To do it though, maybe something like:

document.onkeydown = document.onkeypress = document.onkeyup = function(evt) {
var event = evt || window.event;
if (String.fromCharCode(event.which || event.keyCode).toLowerCase() == 'r' && event.ctrlKey) {
if (typeof event.stopPropagation != 'undefined') {
event.stopPropagation();
event.preventDefault();
}
else {
event.returnValue = false;
event.cancelBubble = true;
}
}
}

No guarentees though.
__________________
jasonkarldavis.com
jkd is offline   Reply With Quote
Old 06-22-2002, 01:18 AM   PM User | #4
whammy
Senior Coder

 
Join Date: Jun 2002
Location: 41° 8' 52" N -95° 53' 31" W
Posts: 3,660
Thanks: 0
Thanked 0 Times in 0 Posts
whammy is an unknown quantity at this point
And, if that works, good luck trying to see your new version of the page when you've made any update...
__________________
Former ASP Forum Moderator - I'm back!

If you can teach yourself how to learn, you can learn anything. ;)
whammy is offline   Reply With Quote
Old 06-22-2002, 12:01 PM   PM User | #5
Alias
New Coder

 
Join Date: Jun 2002
Location: EUROPE
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Alias is an unknown quantity at this point
thanx friends !!!

thanx for all comments. very usefull.

"Personally, I dislike any site which attempts to disable any keyboard or mouse action related to the GUI."
... this comment is OK - me too - but I need this because of visitors.... but it is hard to explain very complicated problem ... and this is one way of solution ...

once again - thanx

best regards
Alias is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:38 AM.


Advertisement
Log in to turn off these ads.