Skip to content

Commit

Permalink
fix: filter for correct usage/usagePage when finding xkeys devices
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Nov 1, 2023
1 parent 7e3f0f1 commit ea8f6ca
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/webhid/src/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ export async function getOpenedXKeysPanels(): Promise<HIDDevice[]> {
}

function isValidXkeysUsage(device: HIDDevice): boolean {
return !!device.collections.find(
(collection) => collection.type === 1 && collection.usage === 1 && collection.usagePage === 12
)
return device.vendorId === XKEYS_VENDOR_ID && !!device.collections.find((collection) => collection.usagePage === 12)
}

/** Sets up a connection to a HID device (the X-keys panel) */
Expand Down

0 comments on commit ea8f6ca

Please sign in to comment.