- Home /
Why right alt (alt gr) acts like left ctrl?!
Hi,
I defined four custom axes in Input Manager:
"left shift" or "right shift"
"left ctrl" or "right ctrl"
"left alt"
"right alt"
Then I was setting one enum variable according to certain combinations of these axes. I couldn't be more surprised, when it appeared, that 4. acted like it was 2. I double-checked my code and setting to be sure, but here it is: when I removed "left ctrl" (or both) from 2., "right alt" wasn't doing anything at all. When I left "left ctrl", "right alt" worked as 2. As I said, I double-checked everything, so there's no way I am mistaken.
But now... What the hell? Why is this happening? How to work this around (or is it possible)?
I get the same issue: "Alt Gr" (right alt on AZERTY keyboard) is acting like Left Ctrl
Answer by Deacon2099 · Apr 05, 2019 at 06:31 AM
I'm using Unity 5.5 and still got this issue. Example solution (more like a bypass) is:
If I want to use only Left Control then write "if left control was pressed and right alt was not pressed":
if (Input.GetKeyDown(KeyCode.LeftControl) && !Input.GetKeyDown(KeyCode.RightAlt))
You can add check for "Alt Gr" too if you need it.