[SDL] AltGr and other things

Sami Näätänen sn.ml at bayminer.com
Fri Sep 30 11:17:02 PDT 2005


On Friday 30 September 2005 07:31, Ingo Schmidt wrote:
> Hi!
>
> > How do you combine this information?
>
> Not sure what you mean. I have extended my program:
>
>
> static void process_keyboard_event(SDL_Event &event)
> {
>         SDL_keysym keysym = event.key.keysym;
>         SDLKey sym = keysym.sym;
>         int state = SDL_GetModState();
>         D(bug("scancode = %d ($%02x), keycode = '%s' ($%02x),
>                 state = $%02x, mod = $%02x", keysym.scancode,
>                 keysym.scancode, SDL_GetKeyName(sym), sym, state,
> keysym.mod)); ...
>
>
> I get the following 4 events when I press & release the AltGr key:
>
> scancode = 29 ($1d), keycode = 'left ctrl' ($132), state = $1240, mod
> = $1000 scancode = 56 ($38), keycode = 'right alt' ($133), state =
> $1240, mod = $1040 scancode = 29 ($1d), keycode = 'left ctrl' ($132),
> state = $1000, mod = $1200 scancode = 56 ($38), keycode = 'right alt'
> ($133), state = $1000, mod = $1000

Something wrong with the keyboard layout i would presume.
Can you make small test case, so that we can test this.

> If I press & release left control, I get this:
>
> scancode = 29 ($1d), keycode = 'left ctrl' ($132), state = $1040, mod
> = $1000 scancode = 29 ($1d), keycode = 'left ctrl' ($132), state =
> $1000, mod = $1000
>
> And the key with <,> and | on it produces this:
>
> scancode = 86 ($56), keycode = 'unknown key' ($00), state = $1000,
> mod = $1000 scancode = 86 ($56), keycode = 'unknown key' ($00), state
> = $1000, mod = $1000
>
> I am a bit confused by all this. Or is everything correct and I am
> too silly to see it?
>
> The whole thing was compiled in a cygwin environment. cygwin1.dll is
> needed to run the entire program. Is maybe that the problem?

Most likely I have to say.

> Cheers, Ingo =;->
>
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl




More information about the SDL mailing list