Solved

Overriding IE keyboard shortcut keys

Posted on 2003-11-06
4
674 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I had to do a bit of research to find the answer to this question so I thought I'd share my results.  Due to our outdated mainframe systems, we need to downgrade IE9 to IE8 in order to stay compatible.  We also needed to downgrade Java.  In order to…
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now