Friday, August 13, 2010

XInput Support in Wine

Wine currently lacks XInput support, which means that one can't use gamepads in many modern games. So I did a bit of Wine hacking, temporary results are in this patch and they work with the SimpleController.exe example from the Microsoft SDK.

Some notes about the patch:
  • behaviour on window focus-leave/enter is wrong (disconnects the controller, instead of just disabling events)
  • it only works with xboxdrv, not with xpad (due to the different order of buttons)
  • I so far only implemented the bare minimum to get SimpleController.exe to run, so some parts of the API are still missing and it might not work with a full game
  • it is a quick&dirty patch, proper patch would need some magic to detect the controller dynamically
  • no rumble
Patch is against the Wine git repository.


Speaktrap said...

Nice work! When it will be a mature wine feature?

Grumbel said...

No idea really, I am not currently working on it and Thunderbird on #wine IRC channel seems to have already a much more mature patch (using evdev, instead of jsdev).