SFML community forums
Help => System => Topic started by: Fairlight0110 on March 29, 2024, 05:55:32 pm
-
I've been trying to figure out how to get the key-code from a keypress in isKeyPressed.
This is easy to retrieve from event.key.code, but for the life of me I can't seem to weasel it out of isKeyPressed.
Any help would be appreciated. Thanx in advance.
-
You don't get the keycode from isKeyPressed, you pass as an argument the one you want to check.
https://www.sfml-dev.org/tutorials/2.6/window-inputs.php#keyboard
-
Event handling and real-time input checks are two different concepts.
Whenever possible we recommend to handle events.