The usage page and usage number was changed in 6f0b1adc14 (#630)
This commit is contained in:
committed by
László Monda
parent
ec98e4e1c6
commit
04aa5236c2
@@ -238,7 +238,10 @@ export class UhkHidDevice {
|
|||||||
const dev = devs.find((x: Device) =>
|
const dev = devs.find((x: Device) =>
|
||||||
x.vendorId === Constants.VENDOR_ID &&
|
x.vendorId === Constants.VENDOR_ID &&
|
||||||
x.productId === Constants.PRODUCT_ID &&
|
x.productId === Constants.PRODUCT_ID &&
|
||||||
((x.usagePage === 128 && x.usage === 129) || x.interface === 0));
|
// hidapi can not read the interface number on Mac, so check the usage page and usage
|
||||||
|
((x.usagePage === 128 && x.usage === 129) || // Old firmware
|
||||||
|
(x.usagePage === (0xFF00 | 0x00) && x.usage === 0x01) || // New firmware
|
||||||
|
x.interface === 0));
|
||||||
|
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
this.logService.debug('[UhkHidDevice] UHK Device not found:');
|
this.logService.debug('[UhkHidDevice] UHK Device not found:');
|
||||||
|
|||||||
@@ -71,7 +71,10 @@ function writeDevice(device, data, options={}) {
|
|||||||
function getUhkDevice() {
|
function getUhkDevice() {
|
||||||
const foundDevice = HID.devices().find(device =>
|
const foundDevice = HID.devices().find(device =>
|
||||||
device.vendorId === 0x1d50 && device.productId === 0x6122 &&
|
device.vendorId === 0x1d50 && device.productId === 0x6122 &&
|
||||||
((device.usagePage === 128 && device.usage === 129) || device.interface === 0));
|
// hidapi can not read the interface number on Mac, so check the usage page and usage
|
||||||
|
((device.usagePage === 128 && device.usage === 129) || // Old firmware
|
||||||
|
(device.usagePage === (0xFF00 | 0x00) && device.usage === 0x01) || // New firmware
|
||||||
|
device.interface === 0));
|
||||||
|
|
||||||
if (!foundDevice) {
|
if (!foundDevice) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user