Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different websites use the same HID device, oninputreport only trigger one of the listeners #96

Open
Ltyi opened this issue May 10, 2022 · 4 comments

Comments

@Ltyi
Copy link

Ltyi commented May 10, 2022

Different websites use the same HID device, oninputreport only trigger one of the listeners

How can I make oninputreport trigger both?

// A application
HIDScanner.oninputreport = (e) => {
  console.log("A")
};
// B application
HIDScanner.oninputreport = (e) => {
  console.log("B")
};

First scan:

"A" triggerd

Second scan:

"B" triggerd

@nondebug
Copy link
Collaborator

This should work. Which OS are you using?

@Ltyi
Copy link
Author

Ltyi commented May 11, 2022

This should work. Which OS are you using?

OS is Windows 10 21H2, and the scanner is honeywell 7580g

@nondebug
Copy link
Collaborator

It looks like 7580g is a barcode scanner: Genesis 7580g Hands-Free Scanner

I don't have any barcode scanners so I tested with a USB headset (Jabra Engage) on Windows 10 21H2 and was able to receive input report events on two separate domains. Barcode scanners have special support in Windows 8.1 and later with hidscanner.dll which I suppose could be interfering:

https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/hid-architecture#hid-clients-supported-in-windows

The documentation says access mode is Shared so I wouldn't expect any issues with multiple clients accessing the same input reports. Maybe there's a hidscanner.dll bug where it doesn't work properly when there are multiple clients from the same application?

For other (probably unrelated) issues, users have reported success changing the driver from hidscanner.dll to hidclass.sys. Could you try that and see if it changes the WebHID behavior?

@Ltyi
Copy link
Author

Ltyi commented May 12, 2022

It looks like 7580g is a barcode scanner: Genesis 7580g Hands-Free Scanner

I don't have any barcode scanners so I tested with a USB headset (Jabra Engage) on Windows 10 21H2 and was able to receive input report events on two separate domains. Barcode scanners have special support in Windows 8.1 and later with hidscanner.dll which I suppose could be interfering:

https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/hid-architecture#hid-clients-supported-in-windows

The documentation says access mode is Shared so I wouldn't expect any issues with multiple clients accessing the same input reports. Maybe there's a hidscanner.dll bug where it doesn't work properly when there are multiple clients from the same application?

For other (probably unrelated) issues, users have reported success changing the driver from hidscanner.dll to hidclass.sys. Could you try that and see if it changes the WebHID behavior?

Oh! you're right.

After I changed the driver to hidclass.sys the problem was solved.

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants