wvke-sdk 1.0.20260422
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 +180 -0
- package/dist/assets/image/axis/ef/wc/icon.png.wvke +0 -0
- package/dist/assets/image/axis/ef/wc/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/ef/wc/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/37B/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/37B/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/37B/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-20F/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-20F/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-20F/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-20S/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-20T/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-20T/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-20T/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-20U/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-20U/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-20U/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-20U-020/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-20U-020/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-20U-020/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-37C/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-ABL/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-ABL/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-ABL/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-ARI/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-ARI/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-ARI/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-CYULTRA/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-CYULTRA/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-CYULTRA/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-GAME/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-GAME/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-GAME/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-GAMEL/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-GAMEL/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-GAMEL/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-HL/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-HL/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-HL/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-LYZ/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-LYZ/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-LYZ/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-MAX/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-MAX/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-MAX/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-PRO/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-PRO/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-PRO/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-SDZ/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-SDZ/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-SDZ/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-SJZ/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-SJZ/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-SJZ/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-XHBZ/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-XHBZ/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-XHBZ/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-XHFZ/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-XHFZ/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-XHFZ/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-YHZ/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-YHZ/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-YHZ/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-YHZP/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-YHZP/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-YHZP/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-YJZ/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-YJZ/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-YJZ/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-YLZ/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-YLZ/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-YLZ/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-ZL/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-ZL/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-ZL/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-ZLZ/icon.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-ZLZ/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/gateron/KS-ZLZ/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/hexgears/bl/icon.png.wvke +0 -0
- package/dist/assets/image/axis/hexgears/bl/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/hexgears/bl/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/hexgears/vc/icon.png.wvke +0 -0
- package/dist/assets/image/axis/hexgears/vc/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/hexgears/vc/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/bjl/icon.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/bjl/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/bjl/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/bl/icon.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/bl/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/bl/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/boxdg/icon.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/boxdg/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/boxdg/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/cs/icon.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/cs/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/cs/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/jc/icon.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/jc/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/jc/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/jgz/icon.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/jgz/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/jgz/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/lm/icon.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/lm/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/lm/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/lr/icon.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/lr/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/lr/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/mxdg/icon.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/mxdg/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/mxdg/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/ql/icon.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/ql/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/ql/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/sm/icon.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/sm/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/sm/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/tkc/icon.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/tkc/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/tkc/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/vc/icon.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/vc/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/vc/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/xc/icon.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/xc/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/xc/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/zy/icon.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/zy/z_b.png.wvke +0 -0
- package/dist/assets/image/axis/kailh/zy/z_y.png.wvke +0 -0
- package/dist/assets/image/axis/ttc/jcz/icon.png.wvke +0 -0
- package/dist/assets/image/axis/ttc/pom/icon.png.wvke +0 -0
- package/dist/assets/image/axis/ttc/rgbwcw/icon.png.wvke +0 -0
- package/dist/assets/image/axis/ttc/twc/icon.png.wvke +0 -0
- package/dist/assets/image/axis/ttc/wcw/icon.png.wvke +0 -0
- package/dist/assets/image/command_icon/media/BrightnessD.png.wvke +0 -0
- package/dist/assets/image/command_icon/media/BrightnessU.png.wvke +0 -0
- package/dist/assets/image/command_icon/media/Mute.png.wvke +0 -0
- package/dist/assets/image/command_icon/media/Playpause.png.wvke +0 -0
- package/dist/assets/image/command_icon/media/calc.png.wvke +0 -0
- package/dist/assets/image/command_icon/media/email.png.wvke +0 -0
- package/dist/assets/image/command_icon/media/next.png.wvke +0 -0
- package/dist/assets/image/command_icon/media/player.png.wvke +0 -0
- package/dist/assets/image/command_icon/media/previous.png.wvke +0 -0
- package/dist/assets/image/command_icon/media/profiles.png.wvke +0 -0
- package/dist/assets/image/command_icon/media/stop.png.wvke +0 -0
- package/dist/assets/image/command_icon/media/volume+.png.wvke +0 -0
- package/dist/assets/image/command_icon/media/volume-.png.wvke +0 -0
- package/dist/assets/image/command_icon/media/web_back.png.wvke +0 -0
- package/dist/assets/image/command_icon/media/web_bookmarks.png.wvke +0 -0
- package/dist/assets/image/command_icon/media/web_home.png.wvke +0 -0
- package/dist/assets/image/command_icon/media/web_refresh.png.wvke +0 -0
- package/dist/assets/image/command_icon/media/web_search.png.wvke +0 -0
- package/dist/assets/image/command_icon/media//350/247/243/351/224/201/351/224/201.png.wvke +0 -0
- package/dist/assets/image/command_icon/mouse/back.png.wvke +0 -0
- package/dist/assets/image/command_icon/mouse/forward.png.wvke +0 -0
- package/dist/assets/image/command_icon/mouse/leftkey.png.wvke +0 -0
- package/dist/assets/image/command_icon/mouse/middlekey.png.wvke +0 -0
- package/dist/assets/image/command_icon/mouse/rightkey.png.wvke +0 -0
- package/dist/assets/image/command_icon/mouse/xj.png.wvke +0 -0
- package/dist/assets/image/command_icon/mouse/xjj.png.wvke +0 -0
- package/dist/assets/image/command_icon/mouse/yj.png.wvke +0 -0
- package/dist/assets/image/command_icon/mouse/yjj.png.wvke +0 -0
- package/dist/assets/image/command_icon/system/Lockcomputer.png.wvke +0 -0
- package/dist/assets/image/command_icon/system/Print.png.wvke +0 -0
- package/dist/assets/image/command_icon/system/Selectall.png.wvke +0 -0
- package/dist/assets/image/command_icon/system/copy.png.wvke +0 -0
- package/dist/assets/image/command_icon/system/desktop.png.wvke +0 -0
- package/dist/assets/image/command_icon/system/find.png.wvke +0 -0
- package/dist/assets/image/command_icon/system/mycomputer.png.wvke +0 -0
- package/dist/assets/image/command_icon/system/newfile.png.wvke +0 -0
- package/dist/assets/image/command_icon/system/paste.png.wvke +0 -0
- package/dist/assets/image/command_icon/system/revoke.png.wvke +0 -0
- package/dist/assets/image/command_icon/system/run.png.wvke +0 -0
- package/dist/assets/image/command_icon/system/save.png.wvke +0 -0
- package/dist/assets/image/command_icon/system/shear.png.wvke +0 -0
- package/dist/assets/image/command_icon/system/togglewindow.png.wvke +0 -0
- package/dist/assets/image/command_icon/system/windowClose.png.wvke +0 -0
- package/dist/assets/image/tools/ADD.png.wvke +0 -0
- package/dist/assets/image/tools/DKS.png.wvke +0 -0
- package/dist/assets/image/tools/END.png.wvke +0 -0
- package/dist/assets/image/tools/HOTKEY.png.wvke +0 -0
- package/dist/assets/image/tools/MACRO.png.wvke +0 -0
- package/dist/assets/image/tools/MPT.png.wvke +0 -0
- package/dist/assets/image/tools/MT.png.wvke +0 -0
- package/dist/assets/image/tools/REST.png.wvke +0 -0
- package/dist/assets/image/tools/RS.png.wvke +0 -0
- package/dist/assets/image/tools/SOCD.png.wvke +0 -0
- package/dist/assets/image/tools/TGL.png.wvke +0 -0
- package/dist/assets/image/tools/auto.png.wvke +0 -0
- package/dist/assets/image/tools/folder.png.wvke +0 -0
- package/dist/assets/image/tools/link.png.wvke +0 -0
- package/dist/assets/image/tools/macro_type.png.wvke +0 -0
- package/dist/assets/image/tools/password.png.wvke +0 -0
- package/dist/assets/image/tools/site.png.wvke +0 -0
- package/dist/assets/image/tools/txt.png.wvke +0 -0
- package/dist/favicon.svg +24 -0
- package/dist/icons.svg +24 -0
- package/dist/index.d.ts +565 -0
- package/dist/logo.svg +34 -0
- package/dist/wvke-sdk.es.js +6649 -0
- package/dist/wvke-sdk.umd.js +1 -0
- package/package.json +17 -0
package/README.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# wvke-sdk
|
|
2
|
+
|
|
3
|
+
wvke-sdk is a JavaScript and TypeScript SDK for gaming peripherals. It is built on WebHID and provides keyboard and mouse APIs for device discovery, initialization, configuration, lighting, and performance features.
|
|
4
|
+
|
|
5
|
+
## Website and Docs
|
|
6
|
+
|
|
7
|
+
- Website: https://www.wvke.top/
|
|
8
|
+
- Documentation: https://www.wvke.top/docs/
|
|
9
|
+
|
|
10
|
+
## Version
|
|
11
|
+
|
|
12
|
+
Current package version: `1.0.20260422`
|
|
13
|
+
|
|
14
|
+
## What's New in 1.0.20260422
|
|
15
|
+
|
|
16
|
+
- Fixed the npm package README publishing flow so the published README now uses `src/lib/README.md` as the single source of truth.
|
|
17
|
+
- Cleaned up the package README structure for npm publishing and aligned package preparation with the `npm-package` directory workflow.
|
|
18
|
+
|
|
19
|
+
## What's New in 1.0.6
|
|
20
|
+
|
|
21
|
+
- Synced the DKS advanced-key API so the `task` parameter now uses the final 4-segment format only.
|
|
22
|
+
- Renamed DKS debug-tool fields from `bits` to `trps` and documented the 7-bit trigger order.
|
|
23
|
+
- Updated Chinese and English higherKey documentation with the trps bit mapping and refreshed website release content.
|
|
24
|
+
|
|
25
|
+
## Install
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install wvke-sdk
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Runtime Requirements
|
|
32
|
+
|
|
33
|
+
- A modern browser with WebHID support.
|
|
34
|
+
- A user gesture before requesting device access.
|
|
35
|
+
- HTTPS or localhost during development and testing.
|
|
36
|
+
|
|
37
|
+
## Main Exports
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
import ServiceKeyboard, {
|
|
41
|
+
ServiceKeyboard,
|
|
42
|
+
ServiceMouse,
|
|
43
|
+
versionManager,
|
|
44
|
+
logger,
|
|
45
|
+
performanceMonitor
|
|
46
|
+
} from 'wvke-sdk'
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
- `ServiceKeyboard`: keyboard SDK service.
|
|
50
|
+
- `ServiceMouse`: mouse SDK service.
|
|
51
|
+
- `versionManager`: SDK version and compatibility helper.
|
|
52
|
+
- `logger`: runtime logger.
|
|
53
|
+
- `performanceMonitor`: operation and connection metrics helper.
|
|
54
|
+
|
|
55
|
+
## Keyboard Quick Start
|
|
56
|
+
|
|
57
|
+
```javascript
|
|
58
|
+
import { ServiceKeyboard } from 'wvke-sdk'
|
|
59
|
+
|
|
60
|
+
const keyboard = new ServiceKeyboard()
|
|
61
|
+
const { code, devices } = await keyboard.getDevices()
|
|
62
|
+
|
|
63
|
+
if (code !== 0 || devices.length === 0) {
|
|
64
|
+
throw new Error('No keyboard devices found')
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
await keyboard.init(devices[0].id)
|
|
68
|
+
|
|
69
|
+
const info = await keyboard.getDevicesInfo()
|
|
70
|
+
console.log(info)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Mouse Quick Start
|
|
74
|
+
|
|
75
|
+
```javascript
|
|
76
|
+
import { ServiceMouse } from 'wvke-sdk'
|
|
77
|
+
|
|
78
|
+
const mouse = new ServiceMouse()
|
|
79
|
+
const devices = await mouse.getDevices()
|
|
80
|
+
|
|
81
|
+
if (devices.length === 0) {
|
|
82
|
+
throw new Error('No mouse devices found')
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
await mouse.init(devices[0].id)
|
|
86
|
+
|
|
87
|
+
const dpi = await mouse.getDPI()
|
|
88
|
+
console.log(dpi)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Examples
|
|
92
|
+
|
|
93
|
+
### Read current keyboard config and polling rate
|
|
94
|
+
|
|
95
|
+
```javascript
|
|
96
|
+
import { ServiceKeyboard } from 'wvke-sdk'
|
|
97
|
+
|
|
98
|
+
const keyboard = new ServiceKeyboard()
|
|
99
|
+
const { code, devices } = await keyboard.getDevices()
|
|
100
|
+
|
|
101
|
+
if (code !== 0 || devices.length === 0) {
|
|
102
|
+
throw new Error('No keyboard devices found')
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const initResult = await keyboard.init(devices[0].id)
|
|
106
|
+
|
|
107
|
+
if (initResult.code !== 0) {
|
|
108
|
+
throw new Error(initResult.info || 'Keyboard initialization failed')
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const currentConfig = await keyboard.getConfig()
|
|
112
|
+
const pollingRate = await keyboard.getRateOfReturn()
|
|
113
|
+
|
|
114
|
+
console.log(currentConfig)
|
|
115
|
+
console.log(pollingRate)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Set keyboard backlight base config
|
|
119
|
+
|
|
120
|
+
```javascript
|
|
121
|
+
await keyboard.setLightingBase({
|
|
122
|
+
data: {
|
|
123
|
+
mode: 2,
|
|
124
|
+
childMode: 1,
|
|
125
|
+
luminance: 3,
|
|
126
|
+
speed: 4
|
|
127
|
+
}
|
|
128
|
+
})
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Read custom keyboard backlight with live reports
|
|
132
|
+
|
|
133
|
+
```javascript
|
|
134
|
+
const handleReport = (payload) => {
|
|
135
|
+
console.log('keyboardBacklightCustomReport', payload)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
keyboard.on('keyboardBacklightCustomReport', handleReport)
|
|
139
|
+
|
|
140
|
+
const snapshot = await keyboard.getKeyboardBacklightCustom()
|
|
141
|
+
console.log(snapshot)
|
|
142
|
+
|
|
143
|
+
const heartbeatId = setInterval(() => {
|
|
144
|
+
keyboard.getKeyboardBacklightCustom().catch(console.error)
|
|
145
|
+
}, 5000)
|
|
146
|
+
|
|
147
|
+
keyboard.off('keyboardBacklightCustomReport', handleReport)
|
|
148
|
+
clearInterval(heartbeatId)
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Read and update mouse DPI
|
|
152
|
+
|
|
153
|
+
```javascript
|
|
154
|
+
import { ServiceMouse } from 'wvke-sdk'
|
|
155
|
+
|
|
156
|
+
const mouse = new ServiceMouse()
|
|
157
|
+
const devices = await mouse.getDevices()
|
|
158
|
+
|
|
159
|
+
if (devices.length === 0) {
|
|
160
|
+
throw new Error('No mouse devices found')
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
await mouse.init(devices[0].id)
|
|
164
|
+
|
|
165
|
+
const currentDpi = await mouse.getDPI()
|
|
166
|
+
await mouse.setDPI(1600)
|
|
167
|
+
|
|
168
|
+
console.log(currentDpi)
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## TypeScript
|
|
172
|
+
|
|
173
|
+
Type declarations are bundled with the package.
|
|
174
|
+
|
|
175
|
+
## Notes
|
|
176
|
+
|
|
177
|
+
- `ServiceKeyboard.getDevices()` returns `{ code, devices }`.
|
|
178
|
+
- `ServiceMouse.getDevices()` returns a device array directly.
|
|
179
|
+
- Keyboard custom backlight and logo custom lighting support real-time report events and heartbeat-based refresh.
|
|
180
|
+
- The package README published to npm is generated from this file via `npm run package:prepare`.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|