Keyboard: Differ between LEFT and RIGHT key

Hello
I’m pretty new to Xojo and I try to create a keymap App (Desktop, macOS). I’m using the Keyboard module which works fine to catch the pressed key: http://documentation.xojo.com/api/hardware/keyboard.html
There is only one problem: How can I differ between LEFT SHIFT and RIGHT SHIFT? Similar problem for any key that exists twice on the keyboard (CMD, ALT).

you probably need to test using he raw keycodes for that (see http://documentation.xojo.com/api/hardware/keyboard.html#keyboard-asynckeydown)
beware this has a different set of issues like keycode NOT being common across various keyboard layouts

Tnx, I’m doing it that way, just with decimal values.
But where’s the difference in checking between in Hex or in Dec? In Hex “a” is 0, similar to Dec. So the Hex value list doesn’t offer me more values to check. The special keys can be checked as well as mentioned at top of http://documentation.xojo.com/api/hardware/keyboard.html but there’s no check difference on f.e. the left and right SHIFT key.
I assume/fear Xojo does just not support that.

no different if you use hex or decimal
just that you end up needing to use the raw scancodes
and scancodes are NOT portable across keyboard layouts etc
this page gives an ok description of what you need along with a LOT of the scan codes for a US keyboard
https://handmade.network/wiki/2823-keyboard_inputs_-_scancodes,_raw_input,_text_input,_key_names

I see, this turns into rocket science…
If I read that right, I can check by scancodes only in Windows (not Mac or Linux). Furthermore I don’t find any function returning a scancode or keyvalue in Xojo. You only can check for a key pressed value.

http://documentation.xojo.com/api/hardware/keyboard.html :


Windows
You can pass raw Win32 key codes to AsyncKeyDown.

[quote=476279:@Farai Aschwanden]I see, this turns into rocket science…
[/quote]
It can VERY quickly

AsyncKeyDown may be the thing you need just that you would have to check EVERY key
http://documentation.xojo.com/api/hardware/keyboard.html#keyboard-asynckeydown

doing this in a short period timer might work well enough

the other thing is you do NOT get keydown events for ANY of the modifier keys (ALT, SHIFT, CMD) etc but asynckeydown could be used to test them

I do not know if the MBS plugins gives you a way to access the lower level APIS that access the keyboard but if they do that might be an option

I’m already using AsyncKeyDown inside a Timer and it works well. The special keys can be checked as well (see Properties on your provided link), just does not differ between the LEFT and RIGHT of a specific special key, like http://documentation.xojo.com/api/hardware/keyboard.html#keyboard-shiftkey

I tried the RawCodes but that doesn’t seem to work (on Apple).

Tnx anyway for you appreciated help.