Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Disable F hotkeys like F5,F4... on IE
5 replies. Latest Post by GuinnessKMF on February 24, 2009.
(0)
jhunter85
Member
6 points
12 Posts
02-19-2009 7:54 AM |
We have silverlight application. In Firefox, F5,F1 don't refresh.I can catch it only from SL. It is good. But in Internet Explorer they refresh page or open help also i catch from SL.
I want to disable F5 to refresh in Internet Explorer.
I tried all methods especially about javascript in live.com or google searches. But they dont work.
Can i disable from Silverlight or javascript?
i dont understand i dont need to do anything in Firefox. But in Internet Explorer i do everything but it is still bad
Thank you very much.
02-20-2009 6:27 AM |
Please someone tells this problem to microsoft internet explorer team. They should fix them. :(
MarkMonster
Contributor
5220 points
1,046 Posts
02-20-2009 12:32 PM |
I'm not sure, but I can think of this bug/feature thing to be by design. Because it might be a security issue if take over the browsers function keys. But I'm no Microsoft employee, but this is something I can imagine.
02-23-2009 5:39 PM |
If microsoft thinks that silverlight kills windows application, they should improve internet explorer. Especialy about performance and keyboard,mouse functions...
02-24-2009 1:28 AM |
I don't agree in here. I can understand your situation but we have to remind ourselves Silverlight is hosted in an application. This can be Internet Explorer, Firefox, Chrome, Safari or any other browser. I don't think it's a natural good thing to take over the application that's hosting the Silverlight plugin. I even think it's rather strange it's supported by Firefox. If I as a user use a browser shortcut, I want this to work. When this behaviour is not wanted a browser application is maybe not the thing you're looking for. You can built of course a WPF application or make use of one of the following articles about hosting a Silverlight plugin inside your own application.
http://silverlightuk.blogspot.com/2008/07/silverlight-desktop-application.html
http://blendables.com/labs/Desklighter/DesklighterStory.aspx
GuinnessKMF
222 points
58 Posts
02-24-2009 11:36 AM |
Mark, what you're missing is that IE does allow you to disable F5, just not for silverlight (although this may indeed be a bug). It's possible to write javascript that cancels propigation of the keypress event for F5, preventing the page from refreshing. But when a silverlight control has focus, you cannot capture the F5 event from javascript or silverlight.
As it stands right now you can (very ugly) hack your way around it by keeping focus on an HTML element, and routing keystrokes into silverlight (meaning you have to implement your own key event stack).
I agree with you that we are in the context of a browser, but all silverlight is, is shoehorning your application into an enviroment that's not ideal, it's an ubiquity of deployment issue that makes silverlight the right choice. Now if a customer is looking at your silverlight page, your silverlight control has focus and they hit F5, meaning refresh, I would think they would want the control's content to refresh, not the control's host. This is especially true if your silverlight application implements its own concept of 'pages', someone would want to refresh a page in your application, not start over and have to log back in. Same goes for F1 or F3 ... If focus is currently in the silverlight application, I likely want help or to search within the application.