Hi,
I have re-posted this as may have got lost somewhere - sorry if you get
duplicate.
I am just joining plib devel in order to suggest some modifications to
joystick
handling in MacOSX for use in FlightGear.
I am just looking at the USB "HID Usage tables" specification and for
Generic Desktop
there are a few other useful things that might be reported by a
joystick or gamepad and
also keypad and Multi-Axis-controller. Maybe we need the
"multi-access-controller' application
and "wheel" dynamic for example? I have already added and submitted to
flightgear the
kHIDUsage_GD_Dial to jsMacOSX.cxx as this is reported by my Saitek X45
joystick but
it needs to be more general.
/* GenericDesktop Page (0x01) */
enum
{
kHIDUsage_GD_Pointer = 0x01, /* Physical Collection */
kHIDUsage_GD_Mouse = 0x02, /* Application Collection */
/* 0x03 Reserved */
kHIDUsage_GD_Joystick = 0x04, /* Application Collection */
kHIDUsage_GD_GamePad = 0x05, /* Application Collection */
kHIDUsage_GD_Keyboard = 0x06, /* Application Collection */
kHIDUsage_GD_Keypad = 0x07, /* Application Collection */
kHIDUsage_GD_MultiAxisController = 0x08, /* Application Collection */
/* 0x09 - 0x2F Reserved */
kHIDUsage_GD_X = 0x30, /* Dynamic Value */
kHIDUsage_GD_Y = 0x31, /* Dynamic Value */
kHIDUsage_GD_Z = 0x32, /* Dynamic Value */
kHIDUsage_GD_Rx = 0x33, /* Dynamic Value */
kHIDUsage_GD_Ry = 0x34, /* Dynamic Value */
kHIDUsage_GD_Rz = 0x35, /* Dynamic Value */
kHIDUsage_GD_Slider = 0x36, /* Dynamic Value */
kHIDUsage_GD_Dial = 0x37, /* Dynamic Value */
kHIDUsage_GD_Wheel = 0x38, /* Dynamic Value */
kHIDUsage_GD_Hatswitch = 0x39, /* Dynamic Value */
also for future reference there is a "Simulation Page" which if we can
make our own
USB "cockpit" device may be useful. For example the following (and
more!) are
specifically mentioned:
/* Simulation Page (0x02) */
/* This section provides detailed descriptions of the usages employed
by simulation devices. */
enum
{
kHIDUsage_Sim_FlightSimulationDevice = 0x01,/* Application Collection
*/
kHIDUsage_Sim_AutomobileSimulationDevice= 0x02,/* Application
Collection */
kHIDUsage_Sim_TankSimulationDevice = 0x03,/* Application Collection */
kHIDUsage_Sim_SpaceshipSimulationDevice= 0x04,/* Application
Collection */
kHIDUsage_Sim_SubmarineSimulationDevice= 0x05,/* Application
Collection */
kHIDUsage_Sim_SailingSimulationDevice = 0x06,/* Application Collection
*/
kHIDUsage_Sim_MotorcycleSimulationDevice= 0x07,/* Application
Collection */
kHIDUsage_Sim_SportsSimulationDevice = 0x08, /* Application Collection
*/
kHIDUsage_Sim_AirplaneSimulationDevice= 0x09, /* Application
Collection */
kHIDUsage_Sim_HelicopterSimulationDevice= 0x0A,/* Application
Collection */
kHIDUsage_Sim_MagicCarpetSimulationDevice= 0x0B,/* Application
Collection */
kHIDUsage_Sim_BicycleSimulationDevice = 0x0C,/* Application Collection
*/
/* 0x0D - 0x1F Reserved */
kHIDUsage_Sim_FlightControlStick = 0x20,/* Application Collection */
kHIDUsage_Sim_FlightStick = 0x21, /* Application Collection */
kHIDUsage_Sim_CyclicControl = 0x22, /* Physical Collection */
kHIDUsage_Sim_CyclicTrim = 0x23, /* Physical Collection */
kHIDUsage_Sim_FlightYoke = 0x24, /* Application Collection */
kHIDUsage_Sim_TrackControl = 0x25, /* Physical Collection */
/* 0x26 - 0xAF Reserved */
kHIDUsage_Sim_Aileron = 0xB0, /* Dynamic Value */
kHIDUsage_Sim_AileronTrim = 0xB1, /* Dynamic Value */
kHIDUsage_Sim_AntiTorqueControl = 0xB2,/* Dynamic Value */
kHIDUsage_Sim_AutopilotEnable = 0xB3, /* On/Off Control */
kHIDUsage_Sim_ChaffRelease = 0xB4, /* One-Shot Control */
kHIDUsage_Sim_CollectiveControl = 0xB5,/* Dynamic Value */
kHIDUsage_Sim_DiveBrake = 0xB6, /* Dynamic Value */
etc. etc.
cheers
Jim
|