Im trying to write a code using SFML library, when I press a key I change a bool variable. The problem is that I use key presses and I don't know how to implement key release who only works 1 time x key and that's what I'm trying to implement cause key press affects multiple times changing all time the variable.
if (Keyboard.IsKeyPressed(Keyboard.Key.A))
{
values[0] = !values[0];
}
if (Keyboard.IsKeyPressed(Keyboard.Key.S))
{
values[1] = !values[1];
}
if (Keyboard.IsKeyPressed(Keyboard.Key.D))
{
values[2] = !values[2];
}
Thanks