Created
September 8, 2011 10:14
-
-
Save AngryAnt/1203085 to your computer and use it in GitHub Desktop.
Untested example of dealing with handled events and focused controls.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const string controlName = "My text field"; | |
string myString = "Text"; | |
void OnGUI () | |
{ | |
EventType handledEventType = Event.current.type; | |
GUI.SetNextControlName (controlName); | |
myString = GUILayout.TextField (myString); | |
if (Event.current.alt && handledEventType == EventType.mouseDown && Event.current.type == EventType.used && GUI.GetNameOfFocusedControl () == controlName) | |
{ | |
Debug.Log ("Alt-click handled with focused control being " + controlName); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment