0

I am developing the hard- & software for a keyboard, and I'd like to make a web-based configurator (something like the (chrome-only) Wootility for the Wooting keyboards). Support for Chromium browsers is really easy with WebUSB/HID/Serial etc., but Firefox makes it significantly harder. It should be user-friendly, but I'd gladly use messy JS code hacks. I am thinking about using the Gamepad API, but I'd like to avoid that if possible. Are there any APIs/hacks/workarounds I can use to transmit data to my USB device besides the Gamepad API?

I guess the Filesystem API would be a way, but with how restricted that is on Firefox it's not nice to use (which is my end goal, I hate having to download drivers for every goddamn device, a nice-to-use web configurator would be perfect). Implementing the Gamepad is a bit more complicated due to a few factors, but there has to be another hack that I'm not thinking of. Input to the website is pretty easy (it is a keyboard after all) but output seems pretty hard. Indicator LEDs also probably won't work via JS.

For reference, I am using an Arduino Uno (with a custom USB-capable bootloader) for prototyping, and will probably stick to an ATMEGA chip, but that won't be the issue - if I need to change my chip for that, I'd do it. If all other methods are worse/impossible I'd use the Gamepad API, but I'd like to avoid that if possible.

lxhom
  • 650
  • 4
  • 15
  • (I could also flash the screen and detect that with a light sensor, but that'd be a bit impractical lol) – lxhom Jan 03 '23 at 18:42
  • 1
    What's wrong with gamepad api? – Konrad Jan 03 '23 at 18:43
  • @Konrad Transfering data via rumble/controller number LEDs is pretty hacky, and the library I usually use for HID devices has a few gamepad-related bugs if used in combination with a NKRO keyboard, and I'd have to manually add rumble support, which is a giant pain in the ass – lxhom Jan 03 '23 at 18:47
  • 1
    Off topic, but I'd consider using a more stable platform than web plus "messy JS hacks". Your keyboards should last 20 years but web APIs and web security rules are constantly changing, meaning you'd have to reengineer your software many times during the life of the product. For instance, I used Javascript on my website one time, and the feature broke a few years later because I was loading a file over HTTP instead of HTTPS. – David Grayson Jan 03 '23 at 20:55
  • *I used Javascript on my website one time* - wow – Konrad Jan 03 '23 at 21:01
  • @DavidGrayson 100% agree. I will provide the same thing as an Electron app with it polyfilled so I can be sure that it works regardless of your browser, but as a passionate Electron hater, I'd like to provide a hacky electron-less alternative, even if it might break, because I have that fallback :) – lxhom Jan 03 '23 at 21:05

0 Answers0