Solved

Overriding IE keyboard shortcut keys

Posted on 2003-11-06
4
719 Views
Last Modified: 2008-03-17
Can I get script to override the IE browser shortcut keys like Ctrl+R (Refresh)?
I used onkeydown event for this it overrides if I use an alert function, however if I use some other function it executes the function and then executes the default refresh option. I want to disable the default option.


0
Comment
Question by:satish12577
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
FragMaster_B earned 50 total points
ID: 9740238
You can override some accelerator keys with various different methods. I don't think you'll ever be able to override them all tho. UNless what you're dealing with is an IE Application (HTA). Then you have much more power.

This page tells you what can an can't be canceled. http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onkeydown.asp

You can whack a lot of accelerator keys by simply cancelling the "Ctrl" key. Inside your onkeydown function, you can cancel the "Ctrl" key like this...

if (event.ctrlKey || event.shiftKey || event.altKey){event.returnValue = false}

This script actually cancels any combination of alpha-key with Ctrl, Alt, or Shift. So, Ctrl+R, Ctrl+C, Ctrl+V... they're all canceled and do not respond.



0
 
LVL 27

Expert Comment

by:Asta Cu
ID: 10261447
Please finalize this or update us with what else is needed (since much time has passed since last update).  If one expert helped you, choose that comment to convert it to the accepted answer and flow points to close this.  If more than one expert helped you, choose the Split Points option to share the points among experts you choose.  Your feedback is integral and appreciated.  If you need special handling help, please make that request in the Community Support topic area, and include this question link.

Recommend checking with WindowsUpdate for a Critical Security Patch announced today.  Details here:
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/bulletin/ms04-004.asp

Thanks,
Asta
0
 
LVL 27

Expert Comment

by:Asta Cu
ID: 10397791
satish12577,
No comment has been added lately (15 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: Award points to FragMaster_B http:#9740238

Please leave any comments here within 4 days.

-- Please DO NOT accept this comment as an answer ! --


Thanks,
astaec
EE Cleanup Volunteer
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I spend far too much time on the web keeping up with the news: politics, the environment, computer stuff, the Experts Exchange. It's never-ending. But many of the most informative web pages are overwhelmed with noise: scrolling banners, flashing tex…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question