FAQ

Does RobotJS support global hotkeys?

RobotJS does not register global hotkeys. Electron apps can use Electron’s globalShortcut API; other Node.js apps need a dedicated hotkey library. See #55 for the RobotJS discussion.

Can I take a screenshot with RobotJS?

Yes. robot.screen.capture() returns an Image containing the main display. Pass x, y, width, height to capture a rectangle contained within one active display.

const robot = require("robotjs");

const screenshot = robot.screen.capture();
screenshot.save("./screenshot.bmp");

BMP saving is always available. A PNG-enabled build can save to screenshot.png; check robot.image.supportsPNG first.

Is the Insert key supported?

Yes, on Windows and Linux:

robot.keyTap("insert");

RobotJS does not map an Insert key on macOS.

How about multi-monitor support?

RobotJS 0.8 supports display enumeration and display-aware capture. robot.getDisplays() returns each active display’s signed desktop coordinates, dimensions, identifier, and isMain status. Pass one display’s bounds—or a smaller rectangle inside it—to robot.screen.capture(x, y, width, height).

A capture rectangle must stay within one display and cannot span displays. On Linux, RobotJS reports the current X11 screen.

For any other questions, please submit an issue.