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

Author Topic: Automatic key repeat  (Read 23654 times)

0 Members and 1 Guest are viewing this topic.

MrDoomMaster

  • Newbie
  • *
  • Posts: 26
    • View Profile
Automatic key repeat
« on: February 04, 2008, 07:57:03 pm »
Hi,

I would like to request a method off of sf::Window that provides the user the ability to enable or disable automatic key repeat. When a key is held down, the user constantly receives KeyPressed messages. I would like an option to disable the automatic generation of these messages.

For now I have to have an external array of booleans representing which key is already held down, and ignore the message if that key is held down. This isn't an ideal solution, as I believe SFML could (and should) handle this better.

From a design standpoint having such an option would be more efficient as well, since the messages wouldn't need to travel as far before being ignored.

Thanks!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Automatic key repeat
« Reply #1 on: February 05, 2008, 02:21:30 am »
Yep, it could be done. I'll check this ;)
Laurent Gomila - SFML developer

prchakal

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Automatic key repeat
« Reply #2 on: December 12, 2008, 04:42:30 am »
Anyone have a solution for it?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Automatic key repeat
« Reply #3 on: December 12, 2008, 07:57:18 am »
This is already implemented.
Laurent Gomila - SFML developer

Pol

  • Newbie
  • *
  • Posts: 18
    • View Profile
Automatic key repeat
« Reply #4 on: August 13, 2009, 04:08:58 pm »
What about setting up a delay and interval like at http://www.libsdl.org/cgi/docwiki.cgi/SDL_EnableKeyRepeat ?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Automatic key repeat
« Reply #5 on: August 13, 2009, 05:17:53 pm »
SFML lets the OS handle the delay and interval, so this is perfectly consistent with the user's configuration.
Laurent Gomila - SFML developer