osu.Framework/Graphics/Drawable.cs
/// <summary>
/// Trigger a UI event with <see cref="UIEvent.Target"/> set to this <see cref="Drawable"/>.
/// </summary>
/// <param name="e">The event. Its <see cref="UIEvent.Target"/> will be modified.</param>
/// <returns>The result of event handler.</returns>
Trigger a UI event with  set to this .
Trigger a UI event with set to this .
public bool TriggerEvent(UIEvent e)
        {
            e.Target = this;
            switch (e)
            {
                case MouseMoveEvent mouseMove:
                    return OnMouseMove(mouseMove);
                case HoverEvent hover:
                    return OnHover(hover);
                case HoverLostEvent hoverLost:
                    OnHoverLost(hoverLost);
                    return false;
                case MouseDownEvent mouseDown:
                    return OnMouseDown(mouseDown);
                case MouseUpEvent mouseUp:
                    return OnMouseUp(mouseUp);
                case ClickEvent click:
                    return OnClick(click);
                case DoubleClickEvent doubleClick:
                    return OnDoubleClick(doubleClick);
                case DragStartEvent dragStart:
                    return OnDragStart(dragStart);
                case DragEvent drag:
                    return OnDrag(drag);
                case DragEndEvent dragEnd:
                    return OnDragEnd(dragEnd);
                case ScrollEvent scroll:
                    return OnScroll(scroll);
                case FocusEvent focus:
                    OnFocus(focus);
                    return false;
                case FocusLostEvent focusLost:
                    OnFocusLost(focusLost);
                    return false;
                case KeyDownEvent keyDown:
                    return OnKeyDown(keyDown);
                case KeyUpEvent keyUp:
                    return OnKeyUp(keyUp);
                case JoystickPressEvent joystickPress:
                    return OnJoystickPress(joystickPress);
                case JoystickReleaseEvent joystickRelease:
                    return OnJoystickRelease(joystickRelease);
                default:
                    return false;
            }
        }
public bool TriggerEvent ( UIEvent e ) { e . Target = this ; switch ( e ) { case MouseMoveEvent mouseMove : return OnMouseMove ( mouseMove ) ; case HoverEvent hover : return OnHover ( hover ) ; case HoverLostEvent hoverLost : OnHoverLost ( hoverLost ) ; return false ; case MouseDownEvent mouseDown : return OnMouseDown ( mouseDown ) ; case MouseUpEvent mouseUp : return OnMouseUp ( mouseUp ) ; case ClickEvent click : return OnClick ( click ) ; case DoubleClickEvent doubleClick : return OnDoubleClick ( doubleClick ) ; case DragStartEvent dragStart : return OnDragStart ( dragStart ) ; case DragEvent drag : return OnDrag ( drag ) ; case DragEndEvent dragEnd : return OnDragEnd ( dragEnd ) ; case ScrollEvent scroll : return OnScroll ( scroll ) ; case FocusEvent focus : OnFocus ( focus ) ; return false ; case FocusLostEvent focusLost : OnFocusLost ( focusLost ) ; return false ; case KeyDownEvent keyDown : return OnKeyDown ( keyDown ) ; case KeyUpEvent keyUp : return OnKeyUp ( keyUp ) ; case JoystickPressEvent joystickPress : return OnJoystickPress ( joystickPress ) ; case JoystickReleaseEvent joystickRelease : return OnJoystickRelease ( joystickRelease ) ; default : return false ; } }
Trigger a UI event with  set to this .
Trigger a UI event with set to this .
The result of event handler.
The result of event handler .
e
UIEvent
The event. Its  will be modified.
The event . Its will be modified .