</head> <body> <h1>SendMode <span class="ver">[v1.0.43+]</span></h1> <p>Makes <a href="Send.htm">Send</a> synonymous with SendInput or SendPlay rather than the default (SendEvent). Also makes Click and MouseMove/Click/Drag use the specified method.</p> <pre class="Syntax"><span class="func">SendMode</span> Mode</pre> <h2 id="Parameters">Parameters</h2> <dl> <dt>Mode</dt> <dd><p>Specify one of the following words:</p> <p><strong>Event</strong>: This is the starting default used by all scripts. It uses the <a href="Send.htm#SendEvent">SendEvent</a> method for <a href="Send.htm">Send</a>, <a href="Send.htm">SendRaw</a>, <a href="Click.htm">Click</a>, and <a href="MouseMove.htm">MouseMove</a>/<a href="MouseClick.htm">Click</a>/<a href="MouseClickDrag.htm">Drag</a>.</p> <p><strong>Input</strong>: Switches to the <a href="Send.htm#SendInput">SendInput</a> method for <a href="Send.htm">Send</a>, <a href="Send.htm">SendRaw</a>, <a href="Click.htm">Click</a>, and <a href="MouseMove.htm">MouseMove</a>/<a href="MouseClick.htm">Click</a>/<a href="MouseClickDrag.htm">Drag</a>. Known limitations:</p> <ul> <li>Windows Explorer ignores SendInput's simulation of certain navigational hotkeys such as <kbd>Alt</kbd>+<kbd>&larr;</kbd>. To work around this, use either <code>SendEvent !{Left}</code> or <code>SendInput {Backspace}</code>.</li> </ul> <p><strong>InputThenPlay</strong> <span class="ver">[v1.0.43.02+]:</span> Same as above except that rather than falling back to Event mode when SendInput is <a href="Send.htm#SendInputUnavail">unavailable</a>, it reverts to Play mode (below). This also causes the <a href="Send.htm#SendInput">SendInput command</a> itself to revert to Play mode when SendInput is unavailable.</p> <p id="Play"><strong>Play</strong>: Switches to the <a href="Send.htm#SendPlay">SendPlay</a> method for <a href="Send.htm">Send</a>, <a href="Send.htm">SendRaw</a>, <a href="Click.htm">Click</a>, and <a href="MouseMove.htm">MouseMove</a>/<a href="MouseClick.htm">Click</a>/<a href="MouseClickDrag.htm">Drag</a>. Known limitations:</p> <ul> <li>Characters that do not exist in the current keyboard layout (such as &Ocirc; in English) cannot be sent. To work around this, use <a href="Send.htm#SendEvent">SendEvent</a>.</li> <li>Simulated mouse dragging might have no effect in RichEdit controls (and possibly others) such as those of WordPad and Metapad. To use an alternate mode for a particular drag, follow this example: <code><a href="Send.htm#SendEvent">SendEvent</a> {Click 6 52 Down}{Click 45 52 Up}</code>.</li> <li>Simulated mouse wheel rotation produces movement in only one direction (usually downward, but upward in some applications). Also, wheel rotation might have no effect in applications such as MS Word and Notepad. To use an alternate mode for a particular rotation, follow this example: <code><a href="Send.htm#SendEvent">SendEvent</a> {WheelDown 5}</code>.</li> <li>When using <code>SendMode Play</code> in the auto-execute section (top part of the script), all remapped keys are affected and might lose some of their functionality. See <a href="../misc/Remap.htm#SendPlay">SendPlay remapping limitations</a> for details.</li> <li>SendPlay does not trigger AutoHotkey's hotkeys or hotstrings, or global hotkeys registered by other programs or the OS.</li> </ul></dd> </dl> <h2 id="Remarks">Remarks</h2> <p>Since SendMode also changes the mode of <a href="Click.htm">Click</a> and <a href="MouseMove.htm">MouseMove</a>/<a href="MouseClick.htm">Click</a>/<a href="MouseClickDrag.htm">Drag</a>, there may be times when you wish to use a different mode for a particular mouse event. The easiest way to do this is via <a href="Send.htm#Click">{Click}</a>. For example:</p> <pre>SendEvent {Click 100 200} <em>; SendEvent uses the older, traditional method of clicking.</em></pre> <p>If SendMode is used in the auto-execute section (top part of the script), it also affects <a href="../misc/Remap.htm">keyboard and mouse remapping</a>. In particular, if you use <code>SendMode Play</code> with remapping, see <a href="../misc/Remap.htm#SendPlay">SendPlay remapping limitations</a>.</p> <p><span class="ver">[v1.1.23+]:</span> The built-in variable <strong>A_SendMode</strong> contains the current setting.</p> <p>Every newly launched <a href="../misc/Threads.htm">thread</a> (such as a <a href="../Hotkeys.htm">hotkey</a>, <a href="Menu.htm">custom menu item</a>, or <a href="SetTimer.htm">timed</a> subroutine) starts off fresh with the default setting for this command. That default may be changed by using this command in the auto-execute section (top part of the script).</p> <h2 id="Related">Related</h2> <p><a href="Send.htm">Send</a>, <a href="SetKeyDelay.htm">SetKeyDelay</a>, <a href="SetMouseDelay.htm">SetMouseDelay</a>, <a href="Click.htm">Click</a>, <a href="MouseClick.htm">MouseClick</a>, <a href="MouseClickDrag.htm">MouseClickDrag</a>, <a href="MouseMove.htm">MouseMove</a></p> <h2 id="Examples">Examples</h2> <div class="ex" id="ExBasic"> <p><a class="ex_number" href="#ExBasic"></a> Makes Send synonymous with SendInput. Recommended for new scripts due to its superior speed and reliability.</p> <pre>SendMode Input</pre> </div> <div class="ex" id="ExInputThenPlay"> <p><a class="ex_number" href="#ExInputThenPlay"></a> Makes Send synonymous with SendInput, but falls back to SendPlay if SendInput is not available.</p> <pre>SendMode InputThenPlay</pre> </div> </body> </html>