Requirements:
++ Note: For linux, you need to ensure udev is setup with the correct device permissions for the hidraw driver. +
++ +
++ +
+ + + + + + diff --git a/packages/webhid-demo/src/app.ts b/packages/webhid-demo/src/app.ts new file mode 100644 index 0000000..83a66e7 --- /dev/null +++ b/packages/webhid-demo/src/app.ts @@ -0,0 +1,84 @@ +import { getOpenedSpaceMice, requestSpaceMice, setupSpaceMouse, SpaceMouse } from 'spaceMouse-webhid' + +function appendLog(str: string) { + const logElm = document.getElementById('log') + if (logElm) { + logElm.textContent = `${str}\n${logElm.textContent}` + } +} + +let currentSpaceMouse: SpaceMouse | null = null + +async function openDevice(device: HIDDevice): Promise