Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Did you try overriding the WebBroswer's ProcessCmdKey... I vaguely recall the browser does something funky with bubbing-up events... to do with security. Yeah, here it is:</p> <p><a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.control.processcmdkey.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.windows.forms.control.processcmdkey.aspx</a> Says:</p> <blockquote> <p>This method is called during message preprocessing to handle <strong>command keys</strong>. Command keys are keys that always take precedence over regular input keys. Examples of command keys include accelerators and menu shortcuts. The method must return true to indicate that it has processed the command key, or false to indicate that the key is not a command key. This method is only called when the control is hosted in a Windows Forms application or as an ActiveX control.</p> <p>The ProcessCmdKey method first determines whether the control has a ContextMenu, and if so, enables the ContextMenu to process the command key. If the command key is not a menu shortcut and the control has a parent, the key is passed to the parent's ProcessCmdKey method. The net effect is that command keys are "bubbled" up the control hierarchy. In addition to the key the user pressed, the key data also indicates which, if any, modifier keys were pressed at the same time as the key. Modifier keys include the SHIFT, CTRL, and ALT keys.</p> </blockquote> <p>I don't think it'll let you intercept browser keys at the form level... I think the events are eaten by the WebBrowser control.</p> <p>Cheers. Keith.</p> <hr> <p><strong>EDIT:</strong> </p> <p><a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.keys.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.windows.forms.keys.aspx</a> says:</p> <blockquote> <p>KeyCode The bitmask to extract a key code from a key value. Modifiers The bitmask to extract modifiers from a key value.</p> </blockquote> <p>and the example contains the lines:</p> <pre><code>if(e.KeyCode != Keys.Back) if (Control.ModifierKeys == Keys.Shift) { </code></pre> <p>So I guess you need to bit-twiddle that key into it's component parts.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload