keybd.press: Simulate Key Press

View source: R/main.R

keybd.pressR Documentation

Simulate Key Press

Description

Simulate keyboard key presses. Multiple keys can be pressed simultaneously by using + as separator (see Examples). See keyboard_value for supported keys.

Usage

keybd.press(button, hold = FALSE)

Arguments

button

character. The key press to simulate (not case sensitive).

hold

logical. Whether the key should be held down. If TRUE, the key can be released by pressing the phsical key on the keyboard or by using the keybd.release function.

See Also

keybd.release

Examples

## Not run: 

# press one key
keybd.press("a")

# press multiple keys
keybd.press("Alt+F4")

# press multiple keys using hold
keybd.press("Alt", hold = TRUE)
keybd.press("F4")
keybd.release("Alt")

## End(Not run)

KeyboardSimulator documentation built on Sept. 13, 2023, 5:07 p.m.