Alt Gr as one key, scancode?

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 <@Martin_Erik_Werner>
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20121109/081a2a1f/attachment.pgp

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 :> 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
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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?On Fri, 2012-11-09 at 09:28 -0300, Sik the hedgehog wrote:

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 <@Martin_Erik_Werner>:

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 <@Martin_Erik_Werner>


Martin Erik Werner <@Martin_Erik_Werner>
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20121109/c0eba3df/attachment.pgp

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:

2012/11/9 Martin Erik Werner :> On Fri, 2012-11-09 at 09:28 -0300, Sik the hedgehog wrote:

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 :

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
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org