simulate-native-click

0.7.3 • Public • Published

simulate-native-click

Simple C++/WinApi addon that allow to simulate native clicks. TypeScript definitions inside.

Install

npm install simulate-native-click --save

Usage

var simulateClick = require("simulate-native-click");
 
let x = 100;
let y = 200;
simulateClick.left(hwnd, x, y);
 
= 300;
= 300;
simulateClick.right(hwnd, x, y);
 
simulateClick.getMousePosition(hwnd); // {x, y}
// position relative to window
 
simulateClick.getMousePosition(); // {x, y}
// global screen position returned if no hwnd provided

You can obtain HWND using winctl package https://www.npmjs.com/package/winctl

var win = winctl.GetActiveWindow();
 
let hwnd =  win.getHwnd();
let x = 100;
let y = 200;
simulateClick.left(hwnd, x, y);

You can also use it with electron:

let hwnd =  mainWindow.getNativeWindowHandle();
let x = 100;
let y = 200;
simulateClick.left(hwnd, x, y);

Dependents (0)

Package Sidebar

Install

npm i simulate-native-click

Weekly Downloads

4

Version

0.7.3

License

ISC

Unpacked Size

7.7 kB

Total Files

6

Last publish

Collaborators

  • fireveined