KEY_ALT and KEY_MENU issue

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Ol_Smaug
:warning: Old Version Published before Godot 3 was released.

In my application, I added some code to look for the Alt key to be pressed, but it did not seem to work by checking for a scancode equal to KEY_ALT.

So, I checked the scancode on the event, and when I press my Alt key it is being reported as KEY_MENU instead of KEY_ALT. And if I press the Menu key on my keyboard, it reports as KEY_UNKNOWN. I tried a different keyboard to make sure it wasn’t just mine and it does the same thing.

Can someone else attempt to recreate this so I can confirm it’s not just an issue on my end? Thanks!

func _input(event):
    if (event.type == InputEvent.KEY):
       print(event.scancode)

I get 16777262 (KEY_MENU) when I press Alt, and 33554431 (KEY_UNKNOWN) when I press the Menu key.

Share the script you used to the tests would help a bit.

genete | 2016-08-30 21:57

I updated my post with some more details.

Ol_Smaug | 2016-08-30 22:28

:bust_in_silhouette: Reply From: genete

I have an iMac and use its native keyboard (no menu key) but pressing ‘alt’ key gives me 16777240 which is correct. Other keys are correct too, according to @Global Scope