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

Author Topic: setKeyRepeatEnabled(false) and text entered event  (Read 1743 times)

0 Members and 1 Guest are viewing this topic.


  • Newbie
  • *
  • Posts: 28
    • View Profile
setKeyRepeatEnabled(false) and text entered event
« on: December 05, 2012, 05:31:55 pm »

I'm designing a input high-level system for my game and I have a design problem. If i set setKeyRepeatEnabled(false), which I need for my input system, how will text entered event behave? I mean, if I hold "A", will i get "A" every some time like in text editor or will that function disable key enabling for text entered event too?
Of course I'm asking about text entered event, as obviously I know that it will disable repeating for key pressed event.

« Last Edit: December 05, 2012, 05:33:41 pm by trilavia »


  • SFML Team
  • Hero Member
  • *****
  • Posts: 6272
  • Thor Developer
    • View Profile
    • Bromeon
Re: setKeyRepeatEnabled(false) and text entered event
« Reply #1 on: December 05, 2012, 06:04:14 pm »
When you pass false to setKeyRepeatEnabled(), only one event is triggered if you hold a key for longer time.

By the way, I have also written a high-level input system which handles one-time events (sf::Event) and realtime input (sf::Mouse, sf::Keyboard, sf::Joystick) in a uniform way and which allows you to connect listeners. If you are interested, you can take a look at the tutorial or the API documentation.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: