Skip to content

Commit ba5cb80

Browse files
committed
Added additional examples.
1 parent f250355 commit ba5cb80

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,30 @@ robot.moveMouse(mouse.x,mouse.y+100);
3434
robot.mouseClick();
3535
```
3636

37+
Type "Hello World".
38+
39+
```JavaScript
40+
var robot = require("robotjs");
41+
42+
//Type "Hello Worl".
43+
robot.typeString("Hello Worl");
44+
45+
//Type "d".
46+
robot.keyTap("d");
47+
```
48+
Get pixel color under the mouse.
49+
50+
```JavaScript
51+
var robot = require("robotjs");
52+
53+
//Get mouse position.
54+
var mouse=robot.getMousePos();
55+
56+
//Get pixel color in hex format.
57+
var hex = robot.getPixelColor(mouse.x, mouse.y);
58+
console.log("#" + hex + " at x:" + mouse.x + " y:" + mouse.y);
59+
```
60+
3761
## Building
3862

3963
RobotJS uses [node-gyp](https://github.com/TooTallNate/node-gyp) for building.

0 commit comments

Comments
 (0)