Get some example from API
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
void OnGUI() {
Event e = Event.current;
if (e.isKey)
Debug.Log("Detected key code: " + e.keyCode);
}
}
Any key works except Shift.
First I think maybe it’s some conflict with Editor,then I build the app display the string with GUI.Label,it is still not working,any key else is ok,but Shift,whats wrong with Shift key,why Unity process key different,that doesn’t make sense