Acounting for key modifiers on diferent keyboards

I know how to check for a key modifier, but the problem is I can’t just predict the output of a key with a modifier on all keyboards. For instance, if I press Shift + 1 in my keyboard I get !, but this is not the case with every keyboard. How do I go about fixing this issue?

keycode vs scancodeAm 21.11.2014 um 21:57 schrieb ShiroAisu:

I know how to check for a key modifier, but the problem is I can’t just
predict the output of a key with a modifier on all keyboards. For
instance, if I press Shift + 1 in my keyboard I get !, but this is not
the case with every keyboard. How do I go about fixing this issue?

Also: SDL_TEXTINPUT for text inputAm 21.11.2014 um 22:23 schrieb Daniel Gibson:

keycode vs scancode

Am 21.11.2014 um 21:57 schrieb ShiroAisu:

I know how to check for a key modifier, but the problem is I can’t just
predict the output of a key with a modifier on all keyboards. For
instance, if I press Shift + 1 in my keyboard I get !, but this is not
the case with every keyboard. How do I go about fixing this issue?

Daniel Gibson wrote:

keycode vs scancode

I’ve tried this but the keycode is always equal to the scancode.
I’m using

Code:
std::cout <<SDL_GetScancodeName(e.key.keysym.scancode)
<<" - " <<SDL_GetKeyName(e.key.keysym.sym) <<"\n";

to check them. Am I doing something wrong here? Am I still missing something?

2014-11-21 18:26 GMT-03:00, Daniel Gibson :

Also: SDL_TEXTINPUT for text input

This. Don’t try to enter text directly because you will never account
for everything. It’s not just simple modifiers you need to take into
account, some locales go as far as having input systems where you
enter entire words at a time, not just individual characters.

(there’s one catch: SDL seemingly can’t handle input that replaces
already entered characters… there’s a discussion around that from
some months ago)