I'm using SFML2.0 and am trying to make a wrapper class for my controller/joystick. I read all the input data from my controller and send it off to my controllable object.
I want to have two types of buttons per button press, one that is continues(true false state ) and one that is an action and is set to false after the next frame update.
Here is an example of how I set my button A to true or false with the SFML api. Whereas data is my struct of buttons, and A holds my true/false state every update.
data.A = sf::Joystick::isButtonPressed(i,st::input::A);
But I've also added "data.actionA" which represents the one time action state.
Basically what I want is for actionA to be set false after the update its been set to true. I'm trying to keep track of the previous state. But I seem to fall into this loop where it toggles between true and false every update.
Anyone an idea?