Write a custom driver for an input device

antonio altamura 106 Reputation points
2021-01-27T17:54:34.193+00:00

Hello,
I'm not sure this is the right place to ask, I beg a mod to move this post if not.
Some Benq monitors come with a device you have to connect straight to the monitor (mini-usb type B) for quickly switching among some monitor presets.
I want to find an alternative use for this device, I want to connect it to a pc and use it as an input device (keyboard shortcuts).
Where should I start to read up on how to write such a driver (for windows 10, of course)?

61018-benq-hotkey-puck.jpg

Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,524 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. antonio altamura 106 Reputation points
    2021-01-27T22:38:54.093+00:00

    Browsing around I found this https://stackoverflow.com/questions/3527707/writing-a-keyboard-device-driver
    in which a user says I may need the specification of the hardware interface. I didn't expect that, is that a thing I really need?
    There is no way Benq support would provide me with it...


  2. antonio altamura 106 Reputation points
    2021-01-28T18:53:48.177+00:00

    Yep I can see it in Device Manager. It looks like this

    61563-fix-unknown-usb-device-device-descriptor-request-f.png


  3. Doron Holan 1,801 Reputation points
    2021-01-28T23:56:21.03+00:00

    Getting the device to enumerate isn't really a computer science problem, it is a hardware problem. There is no way to tell the OS (more specifically the USB host controller driver) to fake it out and ignore this error. The device descriptor is fundamental to a functioning usb device. Do you need more information form Beng? ... that depends on what protocol the device uses. If it is a USB spec defined protocol, there is a windows driver for it and you can use an existing Win32 API to communicate with the device. If it is not spec compliant, you can use winusb for raw communication and either reverse engineer the device or have Benq provide a spec sheet.