Why does Input.GetKey(KeyCode.LeftControl) returns true when I press right alt?
Hi there!
I am working on a remapping system and I found a weird issue: pressing the right alt on my keyboard lead to those two functions to return true:
Input.GetKey(KeyCode.LeftControl)
Input.GetKey(KeyCode.RightAlt)
I thought it was some weirdness linked to my build or to my code, so I checked on another computer: same issue. So I wrote those two lines in my Update:
if (Input.GetKey(KeyCode.LeftControl)) Debug.Log("Left control pressed");
and ran an empty scene. When I press my right alt, my console return "Left control pressed" !
Is it a feature? Or a weird bug? Is it an issue with the two keyboards I managed to try it on?
Answer by doublemax · Sep 05, 2016 at 04:07 PM
The right Alt key is not the same as the left one. It's actually Alt+Control combined. So what you're seeing is normal.
Your answer
Follow this Question
Related Questions
Unity input not working "up arrow",KeyBoard Up arrow input not working 0 Answers
How to add score to text when button down? 1 Answer
How do I save separate keycodes presses at same time and store for use later in update? 0 Answers
Check any Input.GetAxis from any Joystick 0 Answers
Input script 1 Answer