I'm in the middle of building a custom gamepad with an Arduino and I've hit a stand still. I've successfully simulated buttons by simply simulating a keystroke, but now I want to add joystick and trigger support, which requires more then just an on or off state.
My Arduino cant be used as an HID device (I've ordered some leonardos they are on their way) so I've wrote a program to talk to the Arduino through the serial port. Every post I read trying to find a solution is always about getting inputs from an HID gamepad, and not actually simulating them with code.
I've literally been searching for a couple weeks, and I've kept putting off on making this post but I really need some help.
To shorten things up, how I simulate a gamepad event.
Here is code on how you would get the button state, but I don't know what to do after..
//Using the Microsoft.Xna.Framework namespace
//This would be how you would get the state from an HID controller.
if (GamePad.GetState(PlayerIndex.One).Buttons.Y == ButtonState.Pressed)
{
//but what would someone do after they get the button state?
//Is it application specific only?
}
Can someone confirm this theory? Which is that gamepads don't actually have events, its up for the software to find the gamepad and get its state from there? I was assuming this was done in the driver but cannot find any info on this.
Thanks.