- Home /
Event.current.keyCode doesnt return shift
Im using this code: void OnGUI() { //Set keyBeingPressed if (Event.current.keyCode != KeyCode.None) { keyBeingPressed = Event.current.keyCode; } }
When I press a button keyBeingPressed becomes equal to it except when I press shift then it just becomes none.. I've tried with my default danish keyboard and with an english keyboard..
Answer by Eno-Khaon · May 15, 2016 at 09:38 AM
Look into EventModifiers for use in event.modifiers. They're for the keys intended to adapt usage of other keys. Similarly, there's "shift" for that key specifically.
Thanks this is was helpful. Still find it odd that it'll recognize ctrl, escape, alt etc but not shift.
Answer by DaRaVeNrK · May 25, 2017 at 04:29 PM
I agree with @Eno-Khaon , but the EventModifiers functionality for the Shift key is not returning while in the editor in unity 5.6.1f1.
I'm not sure if the functionality is working in the standalone build but in the editor the Shift key is not registering at all.
Your answer
Follow this Question
Related Questions
KeyCodes for non-US keyboard layouts 3 Answers
key binding 0 Answers
Particle Collision / Trigger not being reported to On_xx Event 1 Answer
Animation Event Lag 0 Answers