key: Simulate a keystroke

keystrokeR Documentation

Simulate a keystroke

Description

Send one or more keystrokes to the active window.

Usage

keystroke(key, delay = NULL, clearmodifiers = FALSE)
keydown(key, clearmodifiers = FALSE)
keyup(key)
typestring(string, delay = 12, clearmodifiers = FALSE, sep = "\n")

Arguments

key

A character vector describing the keys to type. The key is interpreted as a Keysym (e.g., a, ctrl+a, BackSpace). keystroke will accept multiple keys, either in a single character value, separated by spaces, or in separate character values.

delay

The delay between keystrokes (in milliseconds). Maximum value is 1000. A very small delay (e.g., 0) may not produce all keys.

clearmodifiers

Logical whether to clear input modifiers (such as the shift key).

string

A character value that is typed out literally. Can have embedded spaces and newlines and tabs.

sep

If multiple character values are provided to typestring, they are collapsed to a single value using this separator.

Author(s)

Paul Murrell

References

http://www.semicomplete.com/projects/xdotool/


pmur002/xdotool documentation built on Feb. 6, 2023, 4:21 p.m.