WICG / webusb

Connecting hardware to the web.
https://wicg.github.io/webusb/
Other
1.32k stars 132 forks source link

Composite device - WebUSB together with USB joystick #153

Closed shepherd007 closed 6 years ago

shepherd007 commented 6 years ago

I was experimenting with USB joystick implementation taken from the repository: https://github.com/MHeironimus/ArduinoJoystickLibrary/tree/version-1.0

After changing bcdUSB to 210h and modifying WebUSB example to:

void setup() {
  while (!Serial) {
    ;
  }
  Serial.begin(9600);
  Serial.write("Sketch begins.\r\n> ");
  Serial.flush();
  pinMode(ledPin, OUTPUT);

  // Initialize Joystick Library
  Joystick.begin();
}

Windows was able to recognize both devices - I can see gamepad in Devices and Printers and I can still access WebUSB channel from the browser. But to my surprise it seems that no events are being sent from gamepad - when I go to Windows gamepad properties I don't see any reaction on any of the button. Standalone USB joystick on bcdUSB 200h works fine and I can see button change. So I have suspicion that either USB gamepad functionality is not supported for bcdUSB 210h and above or something is missing in joystick descriptors . Should I also add BOS to joystick as well?

shepherd007 commented 6 years ago

It seems to be working now - therefore closing the issue.