def METHOD_NAME(window, x, y):
    event = PseudoMouseEvent(pos=(x, y), modifiers=input_state.modifiers)
    mev = MouseEvent(event, active=builtins.mouse_is_pressed)
    # Queue a 'mouse_dragged` or `mouse_moved` event, not both similar to p5.js
    p5.sketch._enqueue_event(
        "mouse_dragged" if builtins.mouse_is_pressed else "mouse_moved", mev
    )