On Jun 13, 2016, at 12:11 AM, David Lawrie <david.dljunk@gmail.com> wrote:
>
> Adds support for input features defined by HID Simulation page: Rudder
> (Rz), Throttle (Z), Steering (X), Accelerator (Y), Brake (Rz).
> +static int axis_for_usage_Sim(int usage)
> +{
> +������ ������ switch (usage)
> +������ ������ {
> +������ ������ ������ ������ case kHIDUsage_Sim_Rudder: return AXIS_RZ;
> +������ ������ ������ ������ case kHIDUsage_Sim_Throttle: return AXIS_Z;
> +������ ������ ������ ������ case kHIDUsage_Sim_Steering: return AXIS_X;
> +������ ������ ������ ������ case kHIDUsage_Sim_Accelerator: return AXIS_Y;
> +������ ������ ������ ������ case kHIDUsage_Sim_Brake: return AXIS_RZ;
> +������ ������ }
Is it intentional that Rudder and Brake both map to the same axis?������ Later, when enumerating elements, which comes first and thus "wins" the collision (if they ever appear on the same device) is arbitrary based on enumeration order.������ That OK?
> @@ -404,66 +418,100 @@ static void collect_joystick_elements(joystick_t* joystick, IOHIDElementRef coll
>������ ������ ������ ������ ������ ������ ������ ������ ������break;
>������ ������ ������ ������ ������ ������ ������}
>������ ������ ������ ������ ������ ������ ������case kIOHIDElementTypeInput_Axis:
> -������ ������ ������ ������ ������ ������ {
> -������ ������ ������ ������ ������ ������ ������ ������ TRACE("kIOHIDElementTypeInput_Axis; ignoring\n");
> -������ ������ ������ ������ ������ ������ ������ ������ break;
> -������ ������ ������ ������ ������ ������ }
>������ ������ ������ ������ ������ ������ ������case kIOHIDElementTypeInput_Misc:
It seems that treating kIOHIDElementTypeInput_Axis the same as kIOHIDElementTypeInput_Misc is a separate issue from adding support for the Sim page inputs.������ Or is there an interrelationship that I'm not aware of?������ Is it the case that both Axis and Misc elements can be present with either GD or Sim usage pages?
Some of the debug logging statements have been changed to say "kIOHIDElementTypeInput_Axis/Misc" while others have been left as "kIOHIDElementTypeInput_Misc".������ Is that indicative of something or just an oversight?
> @@ -614,7 +662,7 @@ LRESULT driver_joyGetDevCaps(DWORD_PTR device_id, JOYCAPSW* caps, DWORD size)
>������ ������ ������{
>������ ������ ������ ������ ������int i;
>
> -������ ������ ������ ������ /* complete 95 structure */
> +������ ������ ������ ������ /* complete Win95 structure */
This is an unrelated change.
-Ken