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
Alt Gr as one key, scancode?
Martin Erik Werner
Guest

Hello,
I'm working on a game which uses LCTRL and RALT as keybinds which may,
and likely will, be used in parallel.

Hence the Alt Gr key of some international keyboards (same location as
RALT) causes issues on windows, since here this is interpreted as both
LCTRL and RALT and not a single key, it seems.

Is there any way to recognise Alt Gr as only RALT (or as a single key to
redirect in the code) without interfering with LCTRL at the same time?
i.e. if holding down Alt Gr, one should still be able to press LCTRL and
recognise that in parallel.

Would I be using the Alt Gr scancode for this purpose, and would that be
reasonably reliable if it was used only for windows, or does it vary
wildly with different keyboards anyways?

There was some discussion previously regarding this in but it seems
inconclusive:
http://lists.libsdl.org/htdig.cgi/sdl-libsdl.org/2005-September/051930.html

--
Martin Erik Werner

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Alt Gr as one key, scancode?
Sik


Joined: 26 Nov 2011
Posts: 905
Huh? That doesn't look like expected behavior at all, a single key
should only have a single scancode in my opinion. Is there a bug
report for this? I'm not part of the SDL team but it's probably worth
bringing up to their attention.

2012/11/9 Martin Erik Werner:
Quote:
Hello,
I'm working on a game which uses LCTRL and RALT as keybinds which may,
and likely will, be used in parallel.

Hence the Alt Gr key of some international keyboards (same location as
RALT) causes issues on windows, since here this is interpreted as both
LCTRL and RALT and not a single key, it seems.

Is there any way to recognise Alt Gr as only RALT (or as a single key to
redirect in the code) without interfering with LCTRL at the same time?
i.e. if holding down Alt Gr, one should still be able to press LCTRL and
recognise that in parallel.

Would I be using the Alt Gr scancode for this purpose, and would that be
reasonably reliable if it was used only for windows, or does it vary
wildly with different keyboards anyways?

There was some discussion previously regarding this in but it seems
inconclusive:
http://lists.libsdl.org/htdig.cgi/sdl-libsdl.org/2005-September/051930.html

--
Martin Erik Werner

_______________________________________________
SDL mailing list

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

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Alt Gr as one key, scancode?
Martin Erik Werner
Guest

On Fri, 2012-11-09 at 09:28 -0300, Sik the hedgehog wrote:
Quote:
Huh? That doesn't look like expected behavior at all, a single key
should only have a single scancode in my opinion. Is there a bug
report for this? I'm not part of the SDL team but it's probably worth
bringing up to their attention.

2012/11/9 Martin Erik Werner:
Quote:
Hello,
I'm working on a game which uses LCTRL and RALT as keybinds which may,
and likely will, be used in parallel.

Hence the Alt Gr key of some international keyboards (same location as
RALT) causes issues on windows, since here this is interpreted as both
LCTRL and RALT and not a single key, it seems.

Is there any way to recognise Alt Gr as only RALT (or as a single key to
redirect in the code) without interfering with LCTRL at the same time?
i.e. if holding down Alt Gr, one should still be able to press LCTRL and
recognise that in parallel.

Would I be using the Alt Gr scancode for this purpose, and would that be
reasonably reliable if it was used only for windows, or does it vary
wildly with different keyboards anyways?

There was some discussion previously regarding this in but it seems
inconclusive:
http://lists.libsdl.org/htdig.cgi/sdl-libsdl.org/2005-September/051930.html

--
Martin Erik Werner

I don't know about scancodes, but it's definitely the case that I get
two keysyms from it, as the previous mailing list posting from 2005 was
noting.

Is it true that this is down to how windows handles the key and it's
impossible to distinguish it in SDL, or is there a way around it/is it a
bug in SDL?

--
Martin Erik Werner

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Alt Gr as one key, scancode?
Sik


Joined: 26 Nov 2011
Posts: 905
Welp, was looking around and it seems Windows seems both Ctrl and Alt
key events when AltGr goes down because on several keyboards the right
Alt key is missing, so this is used to emulate that instead. The
solution would be to use either raw input or DirectInput.

Found this, maybe it helps:
http://molecularmusings.wordpress.com/2011/09/05/properly-handling-keyboard-input/

2012/11/9 Martin Erik Werner:
Quote:
On Fri, 2012-11-09 at 09:28 -0300, Sik the hedgehog wrote:
Quote:
Huh? That doesn't look like expected behavior at all, a single key
should only have a single scancode in my opinion. Is there a bug
report for this? I'm not part of the SDL team but it's probably worth
bringing up to their attention.

2012/11/9 Martin Erik Werner:
Quote:
Hello,
I'm working on a game which uses LCTRL and RALT as keybinds which may,
and likely will, be used in parallel.

Hence the Alt Gr key of some international keyboards (same location as
RALT) causes issues on windows, since here this is interpreted as both
LCTRL and RALT and not a single key, it seems.

Is there any way to recognise Alt Gr as only RALT (or as a single key to
redirect in the code) without interfering with LCTRL at the same time?
i.e. if holding down Alt Gr, one should still be able to press LCTRL and
recognise that in parallel.

Would I be using the Alt Gr scancode for this purpose, and would that be
reasonably reliable if it was used only for windows, or does it vary
wildly with different keyboards anyways?

There was some discussion previously regarding this in but it seems
inconclusive:
http://lists.libsdl.org/htdig.cgi/sdl-libsdl.org/2005-September/051930.html

--
Martin Erik Werner

I don't know about scancodes, but it's definitely the case that I get
two keysyms from it, as the previous mailing list posting from 2005 was
noting.

Is it true that this is down to how windows handles the key and it's
impossible to distinguish it in SDL, or is there a way around it/is it a
bug in SDL?

--
Martin Erik Werner

_______________________________________________
SDL mailing list

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

_______________________________________________
SDL mailing list

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