By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,030 Members | 2,277 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,030 IT Pros & Developers. It's quick & easy.

javascript:disable key strokes

P: 1
i have been tryin to program(javascript) 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????????
Apr 27 '06 #1
Share this Question
Share on Google+
3 Replies


P: 1
i have been tryin to program(javascript) 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?
Jul 31 '07 #2

P: 1
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.
Jul 28 '08 #3

acoder
Expert Mod 15k+
P: 16,027
Welcome to Bytes!

To disable key strokes, return false when detecting them on the key events, e.g. onkeypress/down.
Jul 29 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.