# simulate-native-click

> Simulate native clicks in node.js

Latest version **0.7.3** (published 2018-03-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install simulate-native-click
pnpm add simulate-native-click
yarn add simulate-native-click
bun add simulate-native-click
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.7.3 |
| Published | 2018-03-27 |
| First published | 2018-03-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 3 |
| Author | fireveined |
| Maintainers | fireveined |
| Keywords | node, winapi, addon, cpp, native, electron, simulate, click |

## Links

- npm: https://www.npmjs.com/package/simulate-native-click
- Repository: https://github.com/fireveined/node-simulate-native-click
- Issues: https://github.com/fireveined/node-simulate-native-click/issues
- npm.io page: https://npm.io/package/simulate-native-click

## Dependencies (2)

- [nan](https://npm.io/package/nan.md) ^2.9.2
- [node-gyp](https://npm.io/package/node-gyp.md) ^3.6.2

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.7.3 (latest) — 2018-03-27
- 0.7.2 — 2018-03-15
- 0.7.1 — 2018-03-15
- 0.7.0 — 2018-03-14

## README

# simulate-native-click

> Simple C++/WinApi addon that allow to simulate native clicks. TypeScript definitions inside.

## Install

```bash
npm install simulate-native-click --save
```

## Usage

```javascript
var simulateClick = require("simulate-native-click");

let x = 100;
let y = 200;
simulateClick.left(hwnd, x, y);

x = 300;
y = 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

```javascript
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:

```javascript
let hwnd =  mainWindow.getNativeWindowHandle();
let x = 100;
let y = 200;
simulateClick.left(hwnd, x, y);
```

---
_Source: https://npm.io/package/simulate-native-click · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
