SFML community forums

Help => System => Topic started by: Fairlight0110 on March 29, 2024, 05:55:32 pm

Title: Small isKeyPressed question
Post 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.
Title: Re: Small isKeyPressed question
Post by: G. on March 30, 2024, 12:44:53 am
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
Title: Re: Small isKeyPressed question
Post by: eXpl0it3r on March 30, 2024, 01:06:29 pm
Event handling and real-time input checks are two different concepts.

Whenever possible we recommend to handle events.