blaksilk8 / javascript-joystick

Automatically exported from code.google.com/p/javascript-joystick
0 stars 0 forks source link

Feature request: Make joystick model available through API #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It would be very useful if the API would provide the joystick
model. Here is why.

Many 'normal' joysticks cover the range -64K..+64K, on each axis, with
32K being the stick's resting point. However, other devices partition
this range. For example, the G27 Logitech racing wheel: the wheel
portion of the device covers the X-axis, and works as above. The
y-axis is split between the gas pedal and the brake pedal. As I
recall, the gas pedal ranges from 32K at rest to 0 pressed all the
way. The brake pedal ranges from 0 at rest to 32K.

It is therefore important for an application to know the device model
that is plugged in, so that appropriate interpretation can be decided
on. 

Windows solution: The JOYCAPS structure includes an entry szRegKey,
which contains the registry key to information about the respective
joystick's model. The field of interest within that entry is OEMName.
For example, my "Logitech Attack 3" string is in the OEMName field of
HKEY_CURRENT_USER\System\CurrentControlSet\Control\MediaProperties\PrivateProper
ties\Joystick\OEM\VID_046D&PID_C214.

The racing wheel is at a sibling entry, whose OEMName is "G27 Racing
Wheel".

I *assume* that the Firefox plugin, and the ActiveX control on the
Windows side would have access to the registry. Unfortunately, I don't
know whether the MAC side is similarly architected.

Clearly, the API should stay cross-platform, and cross-browser as much
as possible. If this feature would compromise this goal, this request
should be dropped. Carl would have the necessary overview to evaluate
feasibility.

Original issue reported on code.google.com by Paep...@gmail.com on 21 Jun 2010 at 6:36

GoogleCodeExporter commented 8 years ago
There is the getProductName() method, but I'm not happy with the Windows 
implementation so it's not in the public API yet. It will be added in the 
future.

Original comment by cwoffen...@gmail.com on 21 Jun 2010 at 7:58

GoogleCodeExporter commented 8 years ago
getProductName() returns the OEM name.

Original comment by cwoffen...@gmail.com on 10 Oct 2011 at 1:44