HTML5 Gamepad API Doesn't work in FF

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

Post Reply
JoeDuncan
Posts: 3
Joined: Tue Sep 13, 2016 12:40 pm

HTML5 Gamepad API Doesn't work in FF

Post by JoeDuncan »

Hi,

I just received my first SpaceMouse Wireless and I've been trying to get it working with our flagship web app, but so far it only seems to work in Chrome?

I checked "Can I Use" (http://caniuse.com/#search=gamepad) which says that the HTML 5 Gamepad API *should* be supported in both Chrome and FF, but I can only get it to register in Chrome, not FF. I haven't even bothered with IE yet since "Can I Use" says that the Gamepad API isn't supported by IE :(

You can test it out by simply hooking up your SpaceMouse and loading this URL: http://html5gamepad.com/

Everything works fine in Chrome, but nothing shows up in FF.

I've been browsing these forums looking for an answer and I've found a couple of things, but nothing has worked yet :(

I followed the instructions in this post: viewtopic.php?f=37&t=4511&p=46799&hilit=gamepad#p23668 and installed the Javascript Joystick plugin for FF, but it doesn't seem to do anything at all.

I even tried using the Sx2vJoy + vJoy combo described here: https://forums.frontier.co.uk/showthrea ... y-SN2vJoy)

Running vJoy gets a "gamepad" entry to show up for FF in the HTML 5 Gamepad tester, but sadly every version of Sx2vJoy I've tried has crashed :(

Another issue I've noticed is that while the SpaceMouse *does* show up in the Windows joystick control panel (joy.cpl), Windows doesn't seem to pick up any button of axis events for it, nor does the calibration work.

I'm running Windows 7 Enterprise 64 bit, Chrome 52.0.2743.116 and FireFox 48.0.2.

Am I missing something? Does anyone know how to get the SpaceMouse to show up as a Gamepad device in javascript in FireFox?

Thanks!
JoeDuncan
Posts: 3
Joined: Tue Sep 13, 2016 12:40 pm

Re: HTML5 Gamepad API Doesn't work in FF

Post by JoeDuncan »

Additionally, I have also followed instructions from this post:

viewtopic.php?f=25&t=15964&hilit=write+log+file

and turned on "Write Log File" from the systray, and then inspecting the log. From the above posts, I *should* be seeing SpaceMouse events logged like so:

Code: Select all

00000020 17:55:12.969: SendJoystickEvent: Joystick: buttons=0x0, status=0x0, X=25, Y=127, Z=2, RX=0, RY=0, RZ=0, throttle=0, hat=0x0, force=0
00000020 17:55:12.985: SendJoystickEvent: Joystick: buttons=0x0, status=0x0, X=0, Y=127, Z=0, RX=0, RY=0, RZ=0, throttle=0, hat=0x0, force=0
00000020 17:55:13.001: SendJoystickEvent: Joystick: buttons=0x0, status=0x0, X=0, Y=127, Z=0, RX=0, RY=0, RZ=0, throttle=0, hat=0x0, force=0
00000020 17:55:13.017: SendJoystickEvent: Joystick: buttons=0x0, status=0x0, X=-4, Y=0, Z=0, RX=0, RY=0, RZ=0, throttle=0, hat=0x0, force=0
Instead, ALL the "SendJoystickEvent" entries I see look like so:

Code: Select all

00000020 16:7:25.817: SendJoystickEvent: Joystick: buttons=0x0, status=0x0, X=0, Y=0, Z=0, RX=0, RY=0, RZ=0, throttle=0, hat=0x0, force=1
ALL the values are ALWAYS zero, except for "force" which is always 1.
Hypersonic
Posts: 265
Joined: Mon Jul 12, 2010 5:58 pm

Re: HTML5 Gamepad API Doesn't work in FF

Post by Hypersonic »

It works on Chromium browsers (Chrome and Opera) because the Chromium engine accesses controllers via Raw Input. If FF and other browsers would also have GamePad API access Raw Input then it would work there as well.

That JavaScript joystick plugin was merely a stop-gap until GamePad API arrived. GamePad API is an official integrated aspect of HTML5, not a plugin.

http://www.3dconnexion.it/index.php?id= ... ihbh7djqq2
"Digital certificates are required to enable the use of 3Dconnexion products with web programs (JavaScript) running within a web browser context. After being processed by the driver software, the device data is transported over a "local host" connection using the secure "WebSocket" protocol, a standard that requires digital certificates."
It would appear that 3DConnexion does not want 3DMice supported via GamePad API. 3DConnexion could work with the browser vendors to hook up the driver to GamePad API for extra customization that Raw Input doesn't have.

3DConnexion could sell these devices like hotcakes from all of the supported apps that would sprout up due to embracing open APIs (local and web-based.) Imagine effortless zooming/panning in Google Maps, or 5/6 dof control in Google Maps (Earth mode), zoom/pan web-pages & photos, smoothly and continuously scrub through different times on videos any many different rates, just to name a few web-based examples. Most computer peripherals are plug in play. You plug in any monitor, keyboard, 2DMouse, and it just works (at least the basic core functions), then install a driver for extra customization and advanced features. Imagine that for a 3DMouse! OS developers should make it a standard peripheral, just as they have with keyboards and 2DMice. Keyboard inputs text, 2DMice moves pointers, 3DMice moves objects in 3D.
Post Reply