[SDL] AltGr and other things

Ingo Schmidt ich at der-ingo.de
Thu Sep 29 21:31:06 PDT 2005


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

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?

Cheers, Ingo =;->





More information about the SDL mailing list