Web Analytics Made Easy -
StatCounter Ctrl+R ? - CodingForum

Announcement

Collapse
No announcement yet.

Ctrl+R ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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
    Don't forget about F5.

    Comment


    • #3
      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

      Comment


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

        Comment


        • #5
          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

          Comment

          Working...
          X