xInput (xbox360 controller) in quake engines
Moderator: InsideQC Admins
4 posts
• Page 1 of 1
xInput (xbox360 controller) in quake engines
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...)?
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...)?
-

Barnes - Posts: 226
- Joined: Thu Dec 24, 2009 2:26 pm
- Location: Russia, Moscow
Re: xInput (xbox360 controller) in quake engines
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.
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.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Re: xInput (xbox360 controller) in quake engines
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.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
Re: xInput (xbox360 controller) in quake engines
now all work fine
tnx
tnx
-

Barnes - Posts: 226
- Joined: Thu Dec 24, 2009 2:26 pm
- Location: Russia, Moscow
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest