type: Type keys

Description Usage Arguments Note See Also Examples

Description

Type keyboard input by sending key press events.

Usage

1
type(string, failSafe = TRUE)

Arguments

string

String to be typed.

failSafe

Logical flag to allow for emergency stops. Default is TRUE.

Note

If failSafe is TRUE, the function checks whether the mouse cursor is at the upper left position of the screen (pixel: x = 0, y = 0) . If so, the function fails and throws an error, allowing for emergency stops during code execution.

Special characters like "?", "!", ";", "<", ">", "+", "*" are not allowed, since the mapping of the virtual keys in Java deviates from the R generated raw bytes.

See Also

specialKey, delay

Examples

1
2
3
4
5
## Not run: 
type("This is a sentence. Hello.")  # types to R console
type("Hello World!")                # throws an error due to special character

## End(Not run)

rMouse documentation built on May 1, 2019, 9:23 p.m.