SFML community forums

Help => Window => Topic started by: led on January 30, 2010, 10:55:26 pm

Title: The key pressed delay
Post by: led on January 30, 2010, 10:55:26 pm
Hi,

Im doing a sprite to move to the left, and using:
Code: [Select]
if (evento.Type == evento.KeyPressed &&
evento.Key.Code == Key::A)
sMao.SetPosition(sMao.GetPosition().x - (1000*Window.GetFrameTime()),sMao.GetPosition().y);


but, when i press the A button still it does the same as im writing a text: the 1st A goes there but then a delay, after that delay it goes sending the A all over (if always pressed). Is there a solution for that?
Thanks
Title: The key pressed delay
Post by: Laurent on January 30, 2010, 10:58:24 pm
Look at sf::Input. There are more explanations in the tutorial about events.
Title: The key pressed delay
Post by: led on January 31, 2010, 01:02:11 am
It's working now thanks :wink: