fresc81 / javascript-joystick

joystick / gamepad support for node-webkit
0 stars 0 forks source link

Chrome dropping NPAPI plugin support #18

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
http://blog.chromium.org/2013/09/saying-goodbye-to-our-old-friend-npapi.html
http://googlesystem.blogspot.com/2013/09/chrome-to-gradually-drop-support-for.ht
ml

I guess that leaves just Firefox and Opera for JavaScript Joystick's NPAPI 
support.

Original issue reported on code.google.com by gmanmi...@gmail.com on 13 Nov 2013 at 4:16

GoogleCodeExporter commented 8 years ago
Chrome has the Gamepad API so it should still be possible to access 
controllers. Hopefully the other browsers will keep NSAPI support.

Original comment by cwoffen...@gmail.com on 13 Nov 2013 at 4:48

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I've had no luck with Gamepad API with a 3Dmouse. What's cool about JavaScript 
Joystick is that it uses the JOYINFOX structure 
http://msdn.microsoft.com/en-us/library/windows/desktop/dd757112(v=vs.85).aspx
(DX3.0 = WinMM) which my controller does use (only 5/6 axis due to driver 
mapping issues)

I was hoping for DX5.0 support where I can use all 6 axis of my controller (no 
driver mapping issues) 
http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.re
ference.dijoystate(v=vs.85).aspx
This will enable full 6dof 3dmouse control in my 3DMouse-Google Earth program 
https://sites.google.com/site/hypersonicprograms/javascripts/google-earth-3dmous
e

With Gamepad API I can use a whopping 0/6 axis! I'll try to find a forum 
covering Gamepad API and see what I can find out.

Original comment by gmanmi...@gmail.com on 13 Nov 2013 at 6:41

GoogleCodeExporter commented 8 years ago
I looked at doing a plug-in for Pepper, Chrome's NPAPI replacement, but the 
exposed axes are the same available to the Gamepad API. It's no longer possible 
to access DirectX with the new plug-in API.

Original comment by cwoffen...@gmail.com on 8 Dec 2014 at 12:22

GoogleCodeExporter commented 8 years ago
It seems that they've limited what is possible with plugins quite a bit, I 
suppose for increased security?

I finally got GamePad API working, I just needed to press a button to activate 
it! GamePad API uses Raw Input I've discovered, don't even need a driver, which 
is cool since I can bring my controller to any computer with Chrome and use it 
right off the bat!

There's still a reload issue, however 
https://code.google.com/p/chromium/issues/detail?id=413805

Currently I'm using both GamePad API and JavaScript Joystick (for browsers 
without working GamePad API interfaces.) Due to my controller's drivers I can 
only get 5/6 axis with DX3(JOYINFOEX), but I can get the full 6/6 with GamePad 
API. GamePad API also gets the full 10bit precision, Direct Input seems to 
limit to 8bits for some reason.

Original comment by gmanmi...@gmail.com on 9 Dec 2014 at 11:19

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I think it's part security and part ease of use. A Pepper plug-in can be 
written as a Portable Native Client component (PNaCl) and run without an 
installer. The same code will work on Windows, Mac and Chromebook (x86 or ARM).

As for your axes, with the plug-in are you getting X, Y, Z, R, U & V?

Original comment by c...@numfum.com on 10 Dec 2014 at 10:58

GoogleCodeExporter commented 8 years ago
So pepper plugins basically can't access the 'outside world' directly, can only 
use what Chrome makes available to them?

I'm sure the plug-in detects U just fine, problem is my controller driver 
doesn't map to JOYINFOEX.dwUpos, which also causes problems with older games. 
JOYINFOEX being DX3 input structure (now called multi-media.) My controller 
maps fine to the DX5+ input structure DIJOYSTATE, however.

For some reason both structures seem to limit to 8 bit precision, which doesn't 
make much sense since Direct Input values are 16 bit. Since Direct Input 
implementation is closed source I can't even investigate a possible cause. 
Unless I were to disassemble compiled Direct Input files, but that's a bit much!

Original comment by gmanmi...@gmail.com on 10 Dec 2014 at 3:47

GoogleCodeExporter commented 8 years ago
That's right, Pepper can't just call platform specific APIs.

I'd like to replace the MMAPI stuff with DI but real life gets in the way!

Original comment by cwoffen...@gmail.com on 10 Dec 2014 at 4:23

GoogleCodeExporter commented 8 years ago
I figured as much considering the >year initial response! It seems that IE and 
Safari are the remaining hold-outs to GamePad API adoption.
https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API#Browser_compatibili
ty
Although thus far I could only get GamePad API working with my controller on 
Chrome. I wonder if only Chrome uses RawInput, or the only one to read it 
correctly.

JavaScript Joystick is good to have in case GamePad  API isn't working for 
whatever reason. DX5 support would be great if you ever do get time, to utilize 
all 6 axis of 3DMice.

Original comment by gmanmi...@gmail.com on 10 Dec 2014 at 5:21