keybd.press: Simulate Key Press

Description Usage Arguments See Also Examples

View source: R/main.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## 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 Jan. 16, 2021, 5:32 p.m.