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

Author Topic: Repeating keys when held down  (Read 2167 times)

0 Members and 1 Guest are viewing this topic.

Chris12

  • Newbie
  • *
  • Posts: 20
    • View Profile
Repeating keys when held down
« 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Repeating keys when held down
« Reply #1 on: December 19, 2012, 11:02:46 am »
Do you mean that holding the arrow key doesn't trigger multiple KeyPressed events?
Laurent Gomila - SFML developer

Chris12

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Repeating keys when held down
« Reply #2 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.