SendMode

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

SendMode "Input|Play|Event|InputThenPlay"

The first parameter is one of the following words:

Event: Switches to the SendEvent method for Send, SendRaw, Click, and MouseMove/Click/Drag.

Input: This is the starting default used by all scripts. It uses the SendInput method for Send, SendRaw, Click, and MouseMove/Click/Drag. Known limitations:

InputThenPlay: 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 function 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.

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 function. That default may be changed by using this function in the auto-execute section (top part of the script).

Related

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

Examples

SendMode "Input"
SendMode "InputThenPlay"