Skip to content

Instantly share code, notes, and snippets.

@ruturajpatki
Last active September 9, 2023 07:24
Show Gist options
  • Select an option

  • Save ruturajpatki/98ea502f36b8fed899a9f042921aab3d to your computer and use it in GitHub Desktop.

Select an option

Save ruturajpatki/98ea502f36b8fed899a9f042921aab3d to your computer and use it in GitHub Desktop.
List of tokens which can be used in SendKeys.SendWait sequence.
You can use a variety of special tokens with SendKeys to simulate different keys and key combinations. Here's a list of some commonly used special tokens:
{ENTER}: Enter key.
{TAB}: Tab key.
{ESC}: Escape key.
{BACKSPACE}: Backspace key.
{DELETE}: Delete key.
{INSERT}: Insert key.
{HOME}: Home key.
{END}: End key.
{PAGEUP} or {PGUP}: Page Up key.
{PAGEDOWN} or {PGDN}: Page Down key.
{LEFT}: Left arrow key.
{RIGHT}: Right arrow key.
{UP}: Up arrow key.
{DOWN}: Down arrow key.
{F1} through {F12}: Function keys F1 to F12.
{NUMPAD0} through {NUMPAD9}: Numpad keys 0 to 9.
{ADD}: Numpad addition key.
{SUBTRACT}: Numpad subtraction key.
{MULTIPLY}: Numpad multiplication key.
{DIVIDE}: Numpad division key.
{CAPSLOCK}: Caps Lock key.
{NUMLOCK}: Num Lock key.
{SCROLLLOCK}: Scroll Lock key.
+: Plus sign (use as {+} when simulating the plus key).
%: Percent sign (use as {%} when simulating the percent key).
^: Caret (use as {^} when simulating the caret key).
~: Tilde (use as {~} when simulating the tilde key).
( and ): Parentheses (use as ({} and ({}) when simulating left and right parentheses).
You can use these tokens along with regular characters in SendKeys.SendWait to simulate various keypresses and key combinations. Note that the syntax is generally to enclose the token in curly braces {}.
Keep in mind that the behavior of SendKeys may vary depending on the target application and the context in which it's used, so it's essential to test thoroughly with your specific use case to ensure it works as expected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment