crosscontrol is a cross-platform Node.js native addon for automating mouse and keyboard input, and reading screen pixel data. Useful for scripting, testing, and UI automation tasks.
- Move the mouse to any screen coordinates
- Perform left, right, or middle clicks
- Read the current mouse position
- Simulate individual keys or key combinations
- Get the RGB/Hex color of any screen pixel
- ✅ macOS – Fully tested
- 🟡 Windows – In progress (core functions work)
- ❌ Linux – Not supported
npm install crosscontrol
⚠️ Requires native build toolchain:
- macOS: Xcode Command Line Tools
- Windows: Visual Studio with C++ support + Windows Build Tools
- Linux: Not supported
const cc = require('crosscontrol');
cc.moveMouse(500, 300);
cc.clickMouse();
console.log(cc.getMousePosition()); // { x: 500, y: 300 }
cc.typeKey("a");
cc.typeCombo(["ctrl", "c"]);
const rgb = cc.getPixelColor(100, 100);
console.log(rgb); // { r: 255, g: 255, b: 255 }
console.log(cc.getPixelHex(100, 100)); // "#ffffff"
await cc.typeString("hello world\n");moveMouse(x, y)clickMouse()rightClickMouse()middleClickMouse()getMousePosition() → { x, y }
typeKey(key)typeKeyWithState(key, isDown)typeCombo([keys])typeString(str, delay?)
getPixelColor(x, y) → { r, g, b }getPixelHex(x, y) → "#rrggbb"
MIT
Contributions welcome – especially for improving Windows support!