SFML community forums
Help => Window => Topic started by: timewarp on June 27, 2011, 08:33:18 pm
-
I'm trying to get text input from the user, so I need to be able to read in any key press and update a text field accordingly. When I try to read in the numpad period/delete key, the event always returns the key as 0 when numlock is on, but returns Delete when numlock is off. Any suggestions?
Edit: I'm using SFML 2.0 r5469
-
Bump.
-
Bump.
-
Key codes are currently badly handled in SFML, don't waste too much time if you get problems with key codes.
-
Use instead (?):
if (event.Type == sf::Event::TextEntered){
if (event.Text.Unicode == 8 ){ //8 is 'enter' in this example
... do stuff...
}
}
-
TextEntered event is a totally different thing, it provides characters rather than keyboard keys.
-
Key codes are currently badly handled in SFML, don't waste too much time if you get problems with key codes.
Ok, thanks.