SFML community forums

Help => Window => Topic started by: Chris12 on December 19, 2012, 11:00:45 am

Title: Repeating keys when held down
Post by: Chris12 on December 19, 2012, 11:00:45 am
Hi,
I'm coding a textbox control with sfml.
When I hold down a letter button it begins to repeat it after a second like it should be.

My problem is that this only happens in the "TextEntered" event.
But I also need the arrow-keys to have the same functionality.

I know the arrow keys are not text, but there has to be a way to also get those keys to repeat.
After all, every text input control will move the cursor/caret when an arrow key is being held down.
Title: Re: Repeating keys when held down
Post by: Laurent on December 19, 2012, 11:02:46 am
Do you mean that holding the arrow key doesn't trigger multiple KeyPressed events?
Title: Re: Repeating keys when held down
Post by: Chris12 on December 19, 2012, 11:10:32 am
Oh, I'm sorry! I only used TextEntered and Keyboard.GetState() to get the keys.
KeyPressed does what I want! Feel free to delete the thread.