PaleNeutron
PaleNeutron

Reputation: 3215

How to send XInput button?

I want to send a button pressed signal to a game and I have read the APIs in MSDN.

But the APIs there only provide functions which get gamepad state not send signal to PC.

Can any one help me?

Upvotes: 0

Views: 1424

Answers (1)

Chip Burwell
Chip Burwell

Reputation: 443

There is no API for sending a button pressed signal. You will have to write code that monitors the gamepad state every frame and when a button press is detected you send the signal. (Note: You detect the button press by checking the current button flag against the previous frames button flag. If they differ the button has either been pressed or released, depending on flag state.)

A few more details here: Which event to listen for during XInput events

Upvotes: 1

Related Questions