Create a gist now

Instantly share code, notes, and snippets.

Untested example of dealing with handled events and focused controls.
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