* Just because the value exists as printable in a locale doesn't mean the font contains a glyph for it.
I'm aware of that, but whats the recommended handling for this? I wouldn't just want to ignore the letter int that case, wouldn't it be awkard if the player/user tried to type something and it would just skip certain characters like 'a'? Well, just having them not displayed is weird too, but I quess its better to at least get some sort of feedback from the application and at least have it there. I use that check here foremost not to determine what is being displayed, but what content the textbox has, so if I ignore a character, it won't get used by whatever system uses the textbox.
* Even if the locale doesn't support the value as a printable character, the font may contain a glyph for it anyway.
Thats a case I really don't want to support though, before using isalnum, my default arial 16 font appeared to have glyphs for keys like shift, alt, etc... so in that case I'm willing to accept only what is known as valid input.
It is okay to rely on the system for validation when everything is going through the system. In that scenario it isn't yours to control.
But in games, you often have your own custom GUI, and often your own custom fonts. In that case it is yours to control, so you should control it.
If you are using the language-supplied system for characters and glyphs and displays, use the language-supplied validation tests. If you are not using the language-supplied system, you need to validate it with the tools that match your GUI system. If you wrote your GUI system yourself, you need to validate it yourself.
Well, I am using the win32-api to generate my custom font-definition file/font texture in the first place, but I get where you are going at. I gotta admit too, I've just been a little lazy regarding this input-thingy. I already have a custom key-handling routine using my own key-enum etc... , but that is only used to register key events like ecs for close window, shortcuts etc... . I quess I am better off just going full way and finally customize the key-typing-handling as well. Thanks.
Thanks also for the other suggestions!