javascript:disable key strokes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vanya
    New Member
    • Apr 2006
    • 1

    javascript:disable key strokes

    i have been tryin to program(javascr ipt) to disable the following keystroke combinations
    CTRL+O or CTRL+L Go to a new location (O = 79 L = 76)
    CTRL+S Save the current page ( S = 83)
    CTRL+E Open Search in Explorer bar (E = 69)
    CTRL+I Open Favorites in Explorer bar (I = 73)
    CTRL+H Open History in Explorer bar (H=72)
    CTRL+ click In History or Favorites bars, open multiple


    CTRL+LEFT ARROW When in the Address bar, move the cursor left to the next logical break (. or /) (LEFT =37)
    CTRL+RIGHT ARROW When in the Address bar, move the cursor right to the next logical break (. or /)(RGT = 39)
    CTRL+ENTER Add "www." to the beginning and ".com" to the end of the text typed in the Address bar (ENTER= 13)
    CTRL+D Add the current page to your favorites (D = 68)



    ALT+D Select the text in the Address bar (alt=18,D=68)
    ALT+HOME Go to your Home page (ALT= 18,HOME= 36)

    SHIFT+F10 Display a shortcut menu for a link (shift = 16 , f10 = 121)
    folders


    F4 Display the Address bar history (F4= 115)
    F11 Toggle between Full Screen and regular view of


    wherein i have managed to disable the ones NOT in bold
    now the ones in BOLD seem to have the conrol to address bar....or out of the page
    CAN NEBDY HELP????????
  • poptop
    New Member
    • Jul 2007
    • 1

    #2
    Originally posted by vanya
    i have been tryin to program(javascr ipt) to disable the following keystroke combinations
    CTRL+O or CTRL+L Go to a new location (O = 79 L = 76)
    CTRL+S Save the current page ( S = 83)
    CTRL+E Open Search in Explorer bar (E = 69)
    CTRL+I Open Favorites in Explorer bar (I = 73)
    CTRL+H Open History in Explorer bar (H=72)
    CTRL+ click In History or Favorites bars, open multiple


    CTRL+LEFT ARROW When in the Address bar, move the cursor left to the next logical break (. or /) (LEFT =37)
    CTRL+RIGHT ARROW When in the Address bar, move the cursor right to the next logical break (. or /)(RGT = 39)
    CTRL+ENTER Add "www." to the beginning and ".com" to the end of the text typed in the Address bar (ENTER= 13)
    CTRL+D Add the current page to your favorites (D = 68)



    ALT+D Select the text in the Address bar (alt=18,D=68)
    ALT+HOME Go to your Home page (ALT= 18,HOME= 36)

    SHIFT+F10 Display a shortcut menu for a link (shift = 16 , f10 = 121)
    folders


    F4 Display the Address bar history (F4= 115)
    F11 Toggle between Full Screen and regular view of


    wherein i have managed to disable the ones NOT in bold
    now the ones in BOLD seem to have the conrol to address bar....or out of the page
    CAN NEBDY HELP????????
    Hi there,
    IMHO, Javascript operates on the client side and only on the objects contained in the DOM. The ADDRESS bar is not part of the DOM object model. It is part of the browser object model and as such will not be affected by javascript key events. I suppose you could write some sort of add-in to control the address bar text. Seems kind of intrusive though. Who'd want that?

    Comment

    • LesterB40
      New Member
      • Jul 2008
      • 1

      #3
      Hi. Sorry, I don't have any answers to your questions at the moment. I was wondering if I could get your solution to disabling the CTRL+S Save the current page ( S = 83) option, plus any of the others you've figured out? I know, you're gettin' nothin' out of this. :o)

      Thanks.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Welcome to Bytes!

        To disable key strokes, return false when detecting them on the key events, e.g. onkeypress/down.

        Comment

        Working...