In my game i have a HUD that shows an indicator to something, and additionally it can display some details, you hit tab to toggle the display of the indicators by some rule-set, up until now I've used the shift key(+tab) to tell if the player wants to switch the detail on/off, but now the main use of the shift key is to speed up the camera movement speed so it needs to find a new home, I tried to use control( because I have a feeling alt + tab won't work very well) but it just doesn't seems to work. If I'm pressing tab it switches the normal mode perfectly fine, if I'm pressing control it doesn't respond at all. Literally all I changed was the KeyCode from Tab to LeftControl, is this some windows shortcut / unity editor shortcut? doesn't seems to do anything. *search doesn't show anything besides for stuff like xl
It seems to me the KeyCode should still be Tab. The modifier just changed from Shift to Control. In OnGUI, just get that information from the current Event. Code (csharp): Event event = Event.current; if (event.isKey && (event.type == EventType.KeyDown)) { if ((event.keyCode == KeyCode.Tab) && event.control) { // Tab went down while Control was held } } https://docs.unity3d.com/ScriptReference/Event.html