How to drag a widget from an external input?

For some reason, Common UI doesn’t register left-clicks, so I created a dedicated widget to detect clicks.

I want to initiate a drag operation from that dedicated widget to Common UI, but even when I execute DetectDrag via an event dispatcher, the drag does not occur.

Theoretically, I think it should work, but what exactly is missing?

DetectDrag only arms the drag if it runs inside the widget’s own OnMouseButtonDown event and its returned EventReply is actually returned from that event. It works by registering a deferred drag detector for the upcoming gesture — Slate then watches the next moves of the press that’s already in flight. Calling it later from an event dispatcher (after the button-down event has finished routing) does nothing because there’s no active press for it to attach to, which is exactly why your drag never occurs.

Fix: in the dedicated click-detector widget, implement OnMouseButtonDown → call DetectDrag (pass the widget you want to drag, and the key(s), e.g. Left Mouse Button) → return the EventReply output pin. Then OnDragDetected fires on that widget once the pointer moves while held, and you start your drag payload there.

If the click itself comes from elsewhere (your external input), you have two options:

  • Route it as a synthetic press: call OnMouseButtonDown handlers manually won’t arm drags either — instead, bypass DnD and implement the drag yourself: on your input event, capture the pointer (SetCapture) and track moves, calling your CommonUI target’s OnDragOver-equivalent logic directly.
    • Or fix the root cause: CommonUI not registering left-clicks is usually input routing — if a CommonButtonBase is involved, check it’s actually activated/has focus, and that the CommonUI input mode isn’t consuming mouse input before widgets. The dedicated detector widget is a workaround for a config problem worth hunting down, since DnD would then just work natively.