The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Acounting for key modifiers on diferent keyboards
ShiroAisu


Joined: 09 Jun 2010
Posts: 42
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?
Acounting for key modifiers on diferent keyboards
Daniel Gibson
Guest

keycode vs scancode

Am 21.11.2014 um 21:57 schrieb ShiroAisu:
Quote:
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?


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Acounting for key modifiers on diferent keyboards
Daniel Gibson
Guest

Also: SDL_TEXTINPUT for text input

Am 21.11.2014 um 22:23 schrieb Daniel Gibson:
Quote:
keycode vs scancode

Am 21.11.2014 um 21:57 schrieb ShiroAisu:
Quote:
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?



_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Re: Acounting for key modifiers on diferent keyboards
ShiroAisu


Joined: 09 Jun 2010
Posts: 42
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?
Acounting for key modifiers on diferent keyboards
Sik


Joined: 26 Nov 2011
Posts: 905
2014-11-21 18:26 GMT-03:00, Daniel Gibson:
Quote:
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)
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org