SFML community forums

Help => Window => Topic started by: trilavia on December 05, 2012, 05:31:55 pm

Title: setKeyRepeatEnabled(false) and text entered event
Post by: trilavia on December 05, 2012, 05:31:55 pm
Hey.

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.

Thanks!
Title: Re: setKeyRepeatEnabled(false) and text entered event
Post by: Nexus 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 (http://www.bromeon.ch/libraries/thor/v2.0/tutorial-actions.html) or the API documentation (http://www.bromeon.ch/libraries/thor/v2.0/doc/group___events.html).