Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: Ctrl+R ?

  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    EUROPE
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Don't forget about F5.

  • #3
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    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.

  • #4
    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
    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. ;)

  • #5
    New Coder
    Join Date
    Jun 2002
    Location
    EUROPE
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •