So I'm using hidapi to reading input packets from a few xbox controllers I have and one thing frustrating me is that it reports the left and right triggers as a single "rudder" axis with a uint16_t
. Is there any sort of packet I can send to change the report structure? I know that there are games that can use both triggers at the same time. I guess that the Microsoft answer would be to use DirectInput but I would really like to be able to roll my own.
#pragma pack(1)
struct xbox_wireless_controller_report {
static const u8 a = 1;
static const u8 b = 2;
static const u8 x = 4;
static const u8 y = 8;
static const u8 lb = 16;
static const u8 rb = 32;
static const u8 select = 64;
static const u8 start = 128;
static const u8 l3 = 1;
static const u8 r3 = 2;
u16 left_stick_x;
u16 left_stick_y;
u16 right_stick_x;
u16 right_stick_y;
u16 rudder;
u8 buttons; // a, b, x, y, lb, rb, select, start
u8 l3r3;
u8 dpad;
u8 unknown[2]; // just here to make 15 bytes
};
static_assert(sizeof(xbox_wireless_controller_report) == 15);