Reputation: 12745
I want to disable the F11 key in my Silverlight application because I don't want a user to switch to full-screen mode.
Or is there a way I can write my code for F11 key event? I tried with key down event , but not working for F10 and F11 and set of other keys .
Upvotes: 1
Views: 2432
Reputation: 1701
Silverlight prohibits switching to and from fullscreen mode except when handling a user event (such as clicking a button or link), so there is no way of detecting that a user goes full-screen and then reverting it.
From what I can find in the documentation, there is also no way of preventing an application going fullscreen.
On the other hand, MSDN states that a Silverlight application can only work in two-ways: embedded or fullscreen. So if you embed your application this should not be a problem, because full-screen switching in an embedded Silverlight application will only happen if you set Host.Content.IsFullScreen
to true.
Read more about Silverlight and fullscreen support.
Upvotes: 1
Reputation: 11734
I suspect the browser has precedent over the Silverlight plugin.
You could use Javascript to disable key input. Here's a blog post about how: Disable ctrl + n and other ctrl + key combinations in JavaScript
Upvotes: 1