public bool IsActionTriggering(AngleRangeAction action) { if (!IsActionActive(action)) { return(false); } EventType eventType = Event.current.type; if (action == AngleRangeAction.RemoveRange) { if ((eventType == EventType.ValidateCommand || eventType == EventType.ExecuteCommand) && (Event.current.commandName == kSoftDeleteCommandName || Event.current.commandName == kDeleteCommandName)) { if (eventType == EventType.ExecuteCommand) { return(true); } Event.current.Use(); } return(false); } return(eventType == EventType.MouseDown && Event.current.button == 0); }
public bool IsActionActive(AngleRangeAction action) { if (GUIUtility.hotControl != 0) { return(false); } if (action == AngleRangeAction.SelectRange) { return(HandleUtility.nearestControl == m_HoveredRangeID); } if (action == AngleRangeAction.ModifyRange) { return(HandleUtility.nearestControl == m_HoveredHandleID); } if (action == AngleRangeAction.CreateRange) { return(HandleUtility.nearestControl == m_CreateRangeControlID); } if (action == AngleRangeAction.ModifySelector) { return(HandleUtility.nearestControl == m_SelectorControlID); } if (action == AngleRangeAction.RemoveRange) { return(HasKeyboardFocus()); } return(false); }
public bool IsActionFinishing(AngleRangeAction action) { if (!IsActionHot(action)) { return(false); } return((Event.current.type == EventType.MouseUp && Event.current.button == 0) || Event.current.type == EventType.Ignore); }
public bool IsActionHot(AngleRangeAction action) { if (GUIUtility.hotControl == 0) { return(false); } if (action == AngleRangeAction.ModifyRange) { return(GUIUtility.hotControl == m_HotHandleID); } return(false); }