Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>OK turns out what you really want is this: <a href="http://inputsimulator.codeplex.com/" rel="noreferrer">http://inputsimulator.codeplex.com/</a></p> <p>Which has done all the hard work of exposing the <code>Win32 SendInput</code> methods to C#. This allows you to directly send the windows key. This is tested and works:</p> <p><code>InputSimulator.SimulateModifiedKeyStroke(VirtualKeyCode.LWIN, VirtualKeyCode.VK_E);</code></p> <p><strong>Note</strong> however that in some cases you want to specifically send the key to the application (such as <code>ALT+F4</code>), in which case use the <code>Form</code> library method. In others, you want to send it to the OS in general, use the above.</p> <hr> <p><strong>Old</strong></p> <p>Keeping this here for reference, it will not work in all operating systems, and will not always behave how you want. Note that you're trying to send these key strokes to the app, and the OS usually intercepts them early. In the case of Windows 7 and Vista, too early (before the <code>E</code> is sent).</p> <p><code>SendWait("^({ESC}E)")</code> or <code>Send("^({ESC}E)")</code> </p> <p>Note from here: <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx</a></p> <blockquote> <p>To specify that any combination of SHIFT, CTRL, and ALT should be held down while several other keys are pressed, enclose the code for those keys in parentheses. For example, to specify to hold down SHIFT while E and C are pressed, use "+(EC)". To specify to hold down SHIFT while E is pressed, followed by C without SHIFT, use "+EC".</p> </blockquote> <p>Note that since you want <code>ESC</code> and (say) <code>E</code> pressed at the same time, you need to enclose them in brackets.</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