Handmade Hero»Forums»Code
6 posts
None
Day 5: Xinput
There is no search on this site, so sorry if I am repeating something. But I bought a cheap "light wave" controller for testing. But it is not working with the Casey's code. I tried both writing it myself and copy pasting from the source. In my system I have xinput9_1_0.dll and installed xinput3_1.dll also to test. Neither worked.
After some research I found that xinput works with xbox controllers only (correct me if I am wrong). Interesting thing is that windows detects the controller fine and all the buttons are working (tested with joy.ctl). I have never used joysticks with PC, so this is my first try.
I downloaded some software which promised "do something" so that controller will behave as xbox conroller, but it didn't detect it. I don't really like installing random software from internet and would be very pleased if someone showed me what I am doing wrong.
Casey Muratori
801 posts / 1 project
Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero.
Day 5: Xinput
There is a search - it's to your right, under "Your Account".

As for XInput, yes, some joysticks work with it and some don't. To get at the other types, you need to use RawInput or DirectInput, which we will probably implement at some point much later in the stream. There may be some software you can run which vectors RawInput to XInput as an end-user instead, but I don't know much about that.

- Casey
Mārtiņš Možeiko
2559 posts / 2 projects
Day 5: Xinput
You can use this to do that: https://github.com/x360ce/x360ce

This software basically provide Xinput dll wrapper around DirectInput or RawInput. It requires you to place custom Xinput dll file next to game executable and no need to change a line in your code.
6 posts
None
Day 5: Xinput
Thanks.

x360ce does solve the problem but this is strange. Xinput just don't support non microsoft controllers?
Mārtiņš Možeiko
2559 posts / 2 projects
Day 5: Xinput
Yeah, it doesn't.
That's not very strange. It's Microsoft being Microsoft again.
Andrew Bromage
183 posts / 1 project
Research engineer, resident maths nerd (Erdős number 3).
Day 5: Xinput
alfred
Xinput just don't support non microsoft controllers?

My Logitech F310 supports Xinput.