MAMEWorld >> Programming
Index   Flat Mode Flat  

byuu
MAME Fan
Reged: 03/17/06
Posts: 41
Send PM
Re: EDIT: I think I understand what's going on now.
04/02/09 04:27 AM


Funny, I just added support for XInput the other day.

An Xbox 360 controller will work, but with one exception: the left and right triggers (pressure-sensitive analog buttons) are mapped as one single axis. You can map low and high as their own buttons, but if the user tries pressing both at the same time, they cancel each other out.

It's an artificial limitation, as other controllers map each analog button as its own axis just fine.

Luckily the code's really easy, just one function call to XInputGetState() -- no need for initialization / resource freeing, and the return code tells you if the device is connected.

The downside is DirectInput makes it really tough to identify the controllers. I use RawInput's device name to do it, but there's a few other methods.

Further, it requires xinput1_3.dll; which doesn't ship with XP 2k5 or Vista SP0.

And I was just thinking about writing an XAudio 2 driver, heh. It at least shares the WAVEFORMATEX struct, but otherwise it looks quite different from literally everything else in DirectX.

Should share code or something for that







Entire thread
Subject Posted by Posted on
* Capturing analog button input on Windows *DELETED* byuu 03/24/09 01:32 AM
. * Did someone talk to you? Dullaron  03/25/09 07:11 PM
. * Re: Did someone talk to you? StilettoAdministrator  03/26/09 03:15 AM
. * EDIT: I think I understand what's going on now. byuu  03/24/09 01:51 PM
. * Re: EDIT: I think I understand what's going on now. R. Belmont  03/30/09 03:47 PM
. * Re: EDIT: I think I understand what's going on now. byuu  04/02/09 04:27 AM
. * Re: EDIT: I think I understand what's going on now. uRebelScum  04/02/09 08:43 PM
. * Re: EDIT: I think I understand what's going on now. byuu  04/02/09 11:59 PM

Extra information Permissions
Moderator:  Pi 
0 registered and 29 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 5282