record: Record mouse movements

Description Usage Arguments Value Note See Also Examples

Description

Record subsequent mouse movements and print to console.

Usage

1
record(n = 10, timeInterval = 5, failSafe = TRUE)

Arguments

n

number of mouse moves to record. Default is 10.

timeInterval

(seconds). Record after how much seconds. Default is 5.

failSafe

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

Value

Prints "delay(2000); move(x,y); left()" to the console.

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.

The record function calls the coord() function after the specified time interval passed and repeats n times. The console output can be pasted to a script to rapidly build a mouse macro. Unfortunately, this function is a work-around since it is not possible to record mouse events with the Java Robot Class. The console output is basically a template and can be adjusted to the needs of the user.

See Also

coord, pos

Examples

1
2
3
4
## Not run: 
record()

## End(Not run)

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