Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Keyboard Event Question  (Read 1332 times)

0 Members and 1 Guest are viewing this topic.

whitegentleman

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Keyboard Event Question
« 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.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Keyboard Event Question
« Reply #1 on: September 25, 2013, 09:20:41 pm »
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?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Keyboard Event Question
« Reply #2 on: September 25, 2013, 09:21:08 pm »
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.

 

anything