Closed gluxon closed 9 years ago
The other option is if node-webkit has support for the gamepad api. That's what I've used and it works somewhat.
Where can I find this Gamepad API? It doesn't seem to be in the node-webkit wiki pages.
http://www.html5rocks.com/en/tutorials/doodles/gamepad/
On Thu, Aug 8, 2013 at 3:06 PM, Brandon Cheng notifications@github.comwrote:
Where can I find this Gamepad API? It doesn't seem to be in the node-webkit wiki pages.
— Reply to this email directly or view it on GitHubhttps://github.com/Summer-of-FIRST/DriverStation.js/issues/2#issuecomment-22351544 .
Awesome. I just tested that webpage in node-webkit and it supports it. :)
It doesn't seem to work with the Logitech Extreme 3D Pro though.
https://groups.google.com/a/chromium.org/forum/#!topic/chromium-bugs/hiWL8WwqPew
I had some issues with using it correctly at first. The trick is to hold down a face button when it enumerates the joysticks. After that each subsequent enumeration will have it listed. Not sure if that's your issue or not but that's what I struggled with.
On Aug 9, 2013, at 4:58 PM, Brandon Cheng notifications@github.com wrote:
Awesome. I just tested that webpage in node-webkit and it supports it. :)
It doesn't seem to work with the Logitech Extreme 3D Pro though.
https://groups.google.com/a/chromium.org/forum/#!topic/chromium-bugs/hiWL8WwqPew
— Reply to this email directly or view it on GitHub.
Was that with this specific joystick model? The Chromium bug says that it's not even picking it up (which was the case in my testing). I was going to just revert back to node-joystick to handle it. If even that doesn't work, node-usb definitely will (but it'll be more archaic obviously).
Regrading the GamePad integration in node-webkit, this is probably the only barrier to using it: https://github.com/rogerwang/node-webkit/issues/683
Regarding the issues with individual joysticks, I guess the best option is to open a chromium issue for it, or reference an existing one. That's a tricky issue but probably one that will come up regardless of the method used.
@innoying I'm going to agree with that. Rewriting node-sdl is too much for me at the moment (especially with midterms and AP exams soon). My worry is that the Chromium Project maintainers won't take _joystick_s. They're technically different from gamepads.
From the W3C Gamepad documentation (https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html):
"While the primary goal is support for gamepad devices, supporting these two types of analog inputs allows support for other similar devices common to current gaming systems including joysticks, driving wheels, pedals, and accelerometers. As such, the name "gamepad" is exemplary rather than trying to be a generic name for the entire set of devices addressed by this specification."
Ah ok. So we shouldn't have any issues then with getting a patch in.
Edit: I just realized something we need to double check. There's a chromium bug here with a work in progress patch on the Logitech Extreme 3D support. I forgot that the Chromium project and WebKit project split a while ago, so I'm not sure where to go about this.
node-webkit is based on Chromium, not webkit. The name is a bit confusing. It should make it's way in eventually.
That sounds good. :)
I just ran some tests with two joysticks I had on me: Logitech Attack 3 Logitech Gamepad F310
Two pretty common joysticks for FRC, work perfectly with the Gamepad API.
EDIT: This was tested in Chrome on Mac OS X, not on webkit, and not on other platforms yet.
Closing as invalid due to alternative solution in https://github.com/gluxon/DriverStation.js/pull/13
So far node-joystick appears to have everything we need to grab standard FRC joysticks.
Anyone that would like to play around with node-joystick and report back, please assign yourself to this issue.