Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Window
»
How to filter out weird characters in TextEntered event?
Print
Pages: [
1
]
Author
Topic: How to filter out weird characters in TextEntered event? (Read 3263 times)
0 Members and 1 Guest are viewing this topic.
iride
Jr. Member
Posts: 88
How to filter out weird characters in TextEntered event?
«
on:
April 27, 2016, 05:18:23 am »
Sometimes I get weird symbols like � through TextEntered
How to filter these out?
«
Last Edit: April 27, 2016, 05:33:18 am by iride
»
Logged
DarkRoku12
Full Member
Posts: 203
Lua coder.
Re: How to filter out weird characters in TextEntered event?
«
Reply #1 on:
April 27, 2016, 06:15:52 am »
Where you gets those symbols, printed by the SFML text class or by the system console?
Logged
I would like a spanish/latin community...
Problems building for Android? Look here
Laurent
Administrator
Hero Member
Posts: 32498
Re: How to filter out weird characters in TextEntered event?
«
Reply #2 on:
April 27, 2016, 07:54:38 am »
Do they appear with specific keys or randomly?
Logged
Laurent Gomila - SFML developer
iride
Jr. Member
Posts: 88
Re: How to filter out weird characters in TextEntered event?
«
Reply #3 on:
April 27, 2016, 10:07:36 pm »
Sorry it's not that symbol. It's just a square.
For example, I press ctrl + a and display the character in sf::Text and I see a square.
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: How to filter out weird characters in TextEntered event?
«
Reply #4 on:
April 27, 2016, 10:51:13 pm »
Ctrl + <letter> produces an ASCII control character (CTRL + A gives the "start of heading" character, ASCII code = 1). Those are not printable and can easily be filtered out with the std::isprint standard function.
Logged
Laurent Gomila - SFML developer
Print
Pages: [
1
]
SFML community forums
»
Help
»
Window
»
How to filter out weird characters in TextEntered event?
anything