Forum

Page 1 of 1

xInput (xbox360 controller) in quake engines

PostPosted: Sun May 07, 2017 11:36 am
by Barnes
Some time ago i'm add based xbox360 controller support (based on directQ)
By default left and right lower triggers work as sticks, not as buttons. MH use it for strafe move.
We can map this triggers to some buttons (fire, jumps...)?

Re: xInput (xbox360 controller) in quake engines

PostPosted: Sun May 07, 2017 3:55 pm
by Spike
the analog triggers report values between 0 and 255, yes.
just consider them pressed if they're above 128 and depressed if lower.

buttons = (uint32_t)xinput.buttons;
if (xinput.lefttrigger>127) buttons |= 0x10000;
if (xinput.righttrigger>127) buttons |= 0x20000;

and then pretend it has 18 buttons instead of 16. you can then bind it or not, and scale(via cvar) any stick movement from them to 0 or not.

Re: xInput (xbox360 controller) in quake engines

PostPosted: Mon May 08, 2017 10:21 pm
by mh
I can't remember why I used them for strafe, although I think that the N64 version of Quake used the equivalent buttons, and I would have probably followed that lead.

Re: xInput (xbox360 controller) in quake engines

PostPosted: Sun May 21, 2017 4:44 pm
by Barnes
now all work fine
tnx :wink: