@mukea/uiohook-napi 1.5.4 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -12
- package/package.json +16 -1
- package/prebuilds/darwin/darwin-arm64/@mukea+uiohook-napi.node +0 -0
- package/prebuilds/darwin/darwin-x64/@mukea+uiohook-napi.node +0 -0
- package/prebuilds/linux/linux-arm64/@mukea+uiohook-napi.node +0 -0
- package/prebuilds/linux/linux-x64/@mukea+uiohook-napi.node +0 -0
- package/prebuilds/windows/win32-x64/@mukea+uiohook-napi.node +0 -0
- package/src/lib/uiohook_worker.c +1 -0
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
# uiohook-napi
|
|
1
|
+
# @mukea/uiohook-napi
|
|
2
2
|
|
|
3
|
-
[.
|
|
3
|
+
[](https://www.npmjs.com/package/@mukea/uiohook-napi)
|
|
4
|
+
[](https://github.com/mukea-org/uiohook-napi)
|
|
6
5
|
|
|
6
|
+
N-API C-bindings for [libuiohook](https://github.com/kwhat/libuiohook), available at the [@mukea](https://www.npmjs.com/org/mukea) scope.
|
|
7
7
|
|
|
8
8
|
### Usage example
|
|
9
9
|
|
|
10
10
|
```typescript
|
|
11
|
-
import { uIOhook, UiohookKey } from 'uiohook-napi'
|
|
11
|
+
import { uIOhook, UiohookKey } from '@mukea/uiohook-napi'
|
|
12
12
|
|
|
13
13
|
uIOhook.on('keydown', (e) => {
|
|
14
14
|
if (e.keycode === UiohookKey.Q) {
|
|
@@ -28,19 +28,15 @@ uIOhook.start()
|
|
|
28
28
|
```typescript
|
|
29
29
|
interface UiohookNapi {
|
|
30
30
|
on(event: 'input', listener: (e: UiohookKeyboardEvent | UiohookMouseEvent | UiohookWheelEvent) => void): this
|
|
31
|
-
|
|
32
31
|
on(event: 'keydown', listener: (e: UiohookKeyboardEvent) => void): this
|
|
33
32
|
on(event: 'keyup', listener: (e: UiohookKeyboardEvent) => void): this
|
|
34
|
-
|
|
35
33
|
on(event: 'mousedown', listener: (e: UiohookMouseEvent) => void): this
|
|
36
34
|
on(event: 'mouseup', listener: (e: UiohookMouseEvent) => void): this
|
|
37
35
|
on(event: 'mousemove', listener: (e: UiohookMouseEvent) => void): this
|
|
38
36
|
on(event: 'click', listener: (e: UiohookMouseEvent) => void): this
|
|
39
|
-
|
|
40
37
|
on(event: 'wheel', listener: (e: UiohookWheelEvent) => void): this
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
keyToggle(key: keycode, toggle: 'down' | 'up')
|
|
38
|
+
keyTap(key: keycode, modifiers?: keycode[]): void
|
|
39
|
+
keyToggle(key: keycode, toggle: 'down' | 'up'): void
|
|
44
40
|
}
|
|
45
41
|
|
|
46
42
|
export interface UiohookKeyboardEvent {
|
|
@@ -74,4 +70,4 @@ export interface UiohookWheelEvent {
|
|
|
74
70
|
direction: WheelDirection
|
|
75
71
|
rotation: number
|
|
76
72
|
}
|
|
77
|
-
```
|
|
73
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mukea/uiohook-napi",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "mukea.cc"
|
|
6
6
|
},
|
|
@@ -18,12 +18,16 @@
|
|
|
18
18
|
"keyboard",
|
|
19
19
|
"mouse"
|
|
20
20
|
],
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
21
24
|
"exports": {
|
|
22
25
|
".": {
|
|
23
26
|
"types": "./dist/index.d.ts",
|
|
24
27
|
"default": "./dist/index.js"
|
|
25
28
|
}
|
|
26
29
|
},
|
|
30
|
+
"packageManager": "pnpm@10.25.0",
|
|
27
31
|
"scripts": {
|
|
28
32
|
"install": "node-gyp-build",
|
|
29
33
|
"prebuild": "prebuildify --napi",
|
|
@@ -56,5 +60,16 @@
|
|
|
56
60
|
"gypfile": true,
|
|
57
61
|
"engines": {
|
|
58
62
|
"node": ">=18"
|
|
63
|
+
},
|
|
64
|
+
"overrides": {
|
|
65
|
+
"node-gyp": "^10.0.0"
|
|
66
|
+
},
|
|
67
|
+
"resolutions": {
|
|
68
|
+
"node-gyp": "^10.0.0"
|
|
69
|
+
},
|
|
70
|
+
"pnpm": {
|
|
71
|
+
"overrides": {
|
|
72
|
+
"node-gyp": "^10.0.0"
|
|
73
|
+
}
|
|
59
74
|
}
|
|
60
75
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/lib/uiohook_worker.c
CHANGED
|
@@ -132,6 +132,7 @@ int hook_enable() {
|
|
|
132
132
|
// Get the status back from the thread.
|
|
133
133
|
uv_thread_join(&hook_thread);
|
|
134
134
|
status = hook_thread_status;
|
|
135
|
+
uv_mutex_unlock(&hook_running_mutex);
|
|
135
136
|
}
|
|
136
137
|
else {
|
|
137
138
|
// Lock Failure; The hook is currently running and wait was signaled
|