• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

SOLVED vk_control Returns 'true' if AltGr is Pressed - Is that Expected Behavior?

Nocturne

Friendly Tyrant
Forum Staff
Admin
Tbh, I'm not sure. The AltGr key is a bit of an odd one and it can depend on the keyboard what it actually represents. Technically, iirc, it should really be the combination of LControl + LAlt that results in the AltGr key, but as GM VK constants are for SINGLE keys only, it could be that it simply returns Control. If you want to check left/right alt keys, maybe test using keyboard_check_direct, as that should - in theory - return them independently. Note though that the function is only useful on the Windows target.
 

TsukaYuriko

☄️
Forum Staff
Moderator
AltGr is a key that only exists on specific layouts and the way it works may be specific to the exact implementation. It doesn't have its own key code, so there's no real way to check for it. Check whether pressing AltGr also registers Alt as being pressed. If this is the case, then either your exact keyboard, or all keyboards that use this key (unsure which is the case), implement it by signaling that both of these keys are pressed when AltGr is pressed.
 

TheMagician

Member
Thank you. I thought it might come down to a hardware thing. Yes, when I press AltGr then vk_alt also returns true so at least my keyboard signals AltGr as both keys being pressed.
 
Top