SFML community forums
Help => Window => Topic started by: whitegentleman on September 25, 2013, 09:04:55 pm
-
I wanted to ask if sfml has an event 'KeyDown' because if my key 'KEY_RIGHT' is pressed AND is still pressed my character / sprite moves from one field to another field but THEN he stops for a second and then moves continually like it should from the start. My problem is why does my sprite stop for a second and how can i solve it?
THX in advance.
-
Your problem description is very confusing. Of course there are key pressed events, you can look them up in the tutorial and documentation.
I'm guessing you use events but you actually need real-time input. Have you taken a look at the sf::Keyboard class?
-
I think you want real time input rather than events. See this tutorial: http://sfml-dev.org/tutorials/2.1/window-inputs.php
Events are meant to represent something that happens at exactly one moment in time, like clicking a UI button or releasing a keyboard key or mouse button.