does someone know how to get left and right shift keyCodes by using events in OnGUI function… i dont have any problems doing it in Update function…
// this code works… but does not detect the shift keys
if(kbdGUIEvent.isKey) // kbdGUIEvent is Event.currect type
{
pressCount = 0;
canAssignButton = false;
nputKBD.SetButton(InputKBD.buttonsList[activeButtonIndex], kbdGUIEvent.keyCode);
}
// this code detects shift keys in update with Input instead of Events but doen’t work in OnGUI with Events
if(kbdGUIEvent.keyCode == KeyCode.LeftShift) // does not return true whe i press shift keys
{
Debug.Log("left shift"); // does not return anything
pressCount = 0;
canAssignButton = false;
InputKBD.SetButton(InputKBD.buttonsList[activeButtonIndex], KeyCode.LeftShift);
}
if(kbdGUIEvent.keyCode == KeyCode.RightShift) // does not return true whe i press shift keys
{
Debug.Log("right shift");// does not return anything
pressCount = 0;
canAssignButton = false;
InputKBD.SetButton(InputKBD.buttonsList[activeButtonIndex], KeyCode.RightShift);
}