RodrigoCard wrote:
Ryan C. Gordon wrote:
In the SDL API, the triggers should be axes, to more cleanly map into
the SDL game controller API.Agreed, and further more: can someone with one of these controllers
write a quick test app and see if any of the non-trigger buttons report
anything other than 0.0 and 1.0? I’d be surprised if they do (hence my
thought that Apple simply didn’t want to call the triggers “axes” even
though they really are).Thanks,
–ryan.
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.orgEverything (really! even the Dpad, so they should be mapped to axes not a hat, right?) in these controllers are pressure sensitive.
Look:Code:
#pragma pack(push, 1)
typedef struct {
// Standard information
uint16_t version; //0x0100
uint16_t size; //sizeof(GCExtendedGamepadSnapShotDataV100) or larger// Extended gamepad data // Axes in the range [-1.0, 1.0] float_t dpadX; float_t dpadY; // Buttons in the range [0.0, 1.0] float_t buttonA; float_t buttonB; float_t buttonX; float_t buttonY; float_t leftShoulder; float_t rightShoulder; // Axes in the range [-1.0, 1.0] float_t leftThumbstickX; float_t leftThumbstickY; float_t rightThumbstickX; float_t rightThumbstickY; // Buttons in the range [0.0, 1.0] float_t leftTrigger; float_t rightTrigger;
} GCExtendedGamepadSnapShotDataV100;
#pragma pack(pop)this is in the GCExtendedGamepadSnapshot.h (the non extended are all floats too)
And yes, I tested it myself with a MOGA Ace power, it really have pressure in all the buttons (!)
Also, you can read a property “isPressed” for all buttons (and Dpad) which returns true if there is something more than 15% or 25% of pressure, the buttons feel a bit mushy because of that (you can read the pressure values under 15% too, but it may be noisy).> > On 4/23/14, 4:48 PM, Sam Lantinga wrote:
Rodrigo Cardoso Rocha
@RodrigoRodrigoR - twitter.com/RodrigoRodrigoR
Chibata Creations - chibatacreations.com