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

Author Topic: [Solved] Making key pressed event fire only once  (Read 4598 times)

0 Members and 2 Guests are viewing this topic.

Debonair

  • Newbie
  • *
  • Posts: 16
    • View Profile
[Solved] Making key pressed event fire only once
« on: July 16, 2015, 07:18:51 pm »
Did some search about this, found a solution, which is to use this: window.setKeyRepeatEnabled(false);
But it does not seem to be working, the event is still firing continuously. Is this no longer functional? My SFML version is 2.2.
« Last Edit: July 17, 2015, 07:00:20 pm by Debonair »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Making key pressed event fire only once
« Reply #1 on: July 16, 2015, 07:28:25 pm »
Which OS?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

kitteh-warrior

  • Guest
Re: Making key pressed event fire only once
« Reply #2 on: July 16, 2015, 07:57:51 pm »
But it does not seem to be working, the event is still firing continuously.

If you are using sf::Keyboard::isKeyPressed(), it will always be continuous. window.setKeyRepeatEnabled() only effects events.

Debonair

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Making key pressed event fire only once
« Reply #3 on: July 17, 2015, 08:40:33 am »
Which OS?

Windows 7.

If you are using sf::Keyboard::isKeyPressed(), it will always be continuous. window.setKeyRepeatEnabled() only effects events.

Oh I see. Yeah, I used that. Thanks for the help.