I am exporting a windows game on mac using unity 3D and I am encountering some issues with the key binding: CTRL, ALT, CMD and SHIFT key are not recognized at all (no errors).
I used the following code to see if anything was detected, and it worked for all keys except CTRL, ALT, CMD and SHIFT.
void OnGUI()
{
Event e = Event.current;
//vérifier si une touche est bien pressée
if (e.isKey)
{
Debug.Log("Detected key code: " + e.keyCode);
txt.text = e.keyCode.ToString();
txt2.text = "normal";
}
if(e.modifiers == EventModifiers.Alt)
{
txt.text = e.keyCode.ToString();
txt2.text = "modif";
}
}
Is there a way to make this work ? Thanks in advance.