SendMode [v1.0.43+]

Makes Send synonymous with SendInput or SendPlay rather than the default (SendEvent). Also makes Click and MouseMove/Click/Drag use the specified method.

SendMode Mode

Parameters

Mode

Specify one of the following words:

Event: This is the starting default used by all scripts. It uses the SendEvent method for Send, SendRaw, Click, and MouseMove/Click/Drag.

Input: Switches to the SendInput method for Send, SendRaw, Click, and MouseMove/Click/Drag. Known limitations:

InputThenPlay [v1.0.43.02+]: Same as above except that rather than falling back to Event mode when SendInput is unavailable, it reverts to Play mode (below). This also causes the SendInput command itself to revert to Play mode when SendInput is unavailable.

Play: Switches to the SendPlay method for Send, SendRaw, Click, and MouseMove/Click/Drag. Known limitations:

Remarks

Since SendMode also changes the mode of Click and MouseMove/Click/Drag, 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 {Click}. For example:

SendEvent {Click 100 200}  ; SendEvent uses the older, traditional method of clicking.

If SendMode is used in the auto-execute section (top part of the script), it also affects keyboard and mouse remapping. In particular, if you use SendMode Play with remapping, see SendPlay remapping limitations.

[v1.1.23+]: The built-in variable A_SendMode contains the current setting.

Every newly launched thread (such as a hotkey, custom menu item, or timed 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).

Send, SetKeyDelay, SetMouseDelay, Click, MouseClick, MouseClickDrag, MouseMove

Examples

Makes Send synonymous with SendInput. Recommended for new scripts due to its superior speed and reliability.

SendMode Input

Makes Send synonymous with SendInput, but falls back to SendPlay if SendInput is not available.

SendMode InputThenPlay