SFML community forums
Help => General => Topic started by: Rq on November 21, 2013, 01:41:14 pm
-
Hi,
I would like to catch a quick double pression on a single key to use a function but i cannot see how to do that.
Can you help me please ?
Thank you :)
-
With sf::Clock, you can measure the time between two presses. If it is lower than a certain threshold, perform the desired actions.
-
I would measure the time between two KeyReleased messages for same key instead, to avoid having it accidently triggered by automatic key repeat. Or alternatively measure time between a KeyReleased and the next KeyPressed message if you like to have it activated on key down.