Show / Hide Table of Contents

Method keys.sendL


Overload

Generates virtual keystrokes. Like keys.send, but without reliability features: delays, user input blocking, resetting modifiers/CapsLock.

public static void sendL(params KKeysEtc[] keysEtc)
Parameters
keysEtc  (KKeysEtc[])

Arguments of these types:

  • string - keys. Key names separated by spaces or operators, like "Enter A Ctrl+A".
    Tool: in "" string press Ctrl+Space.
  • string with prefix "!" - literal text.
    Example: var p = "pass"; keys.send("!user", "Tab", "!" + p, "Enter");
  • string with prefix "%" - HTML to paste. Full or fragment.
  • clipboardData - clipboard data to paste.
  • KKey - a single key.
    Example: keys.send("Shift+", KKey.Left, "*3"); is the same as keys.send("Shift+Left*3");
  • int - sleep milliseconds. Max 10000.
    Example: keys.send("Left", 500, "Right");
  • System.Action - callback function.
    Example: Action click = () => mouse.click(); keys.send("Shift+", click);
  • KKeyScan - a single key, specified using scan code and/or virtual-key code and extended-key flag.
    Example: keys.send(new KKeyScan(0x3B, false)); //key F1
    Example: keys.send(new KKeyScan(KKey.Enter, true)); //numpad Enter
  • char - a single character. Like text with OKeyText.KeysOrChar or operator ^.
Exceptions
ArgumentException

An invalid value, for example an unknown key name.

AuException

Failed. When sending text, fails if there is no focused window.

InputDesktopException

Remarks

Ignores opt.key and instead uses default options with these changes:

  • SleepFinally = 0.
  • KeySpeed = 0.
  • NoBlockInput = true.
  • NoCapsOff = true.
  • NoModOff = true.

See Also

keys.more.sendKey