DragHandler
Namespace: Hex1b.Input
Assembly: Hex1b.dll
A handler for drag operations, returned by a drag binding's factory. Receives move and end events for the duration of the drag.
public sealed class DragHandlerInheritance
Object → DragHandler
Constructors
DragHandler(Action<InputBindingActionContext, int, int>?, Action<InputBindingActionContext>?)
Creates a new drag handler with context-aware callbacks.
Parameters:
onMove(Action<InputBindingActionContext, Int32, Int32>): Called during drag with (context, deltaX, deltaY).onEnd(Action<InputBindingActionContext>): Called when drag ends with context.
public DragHandler(Action<InputBindingActionContext, int, int>? onMove = null, Action<InputBindingActionContext>? onEnd = null)Properties
IsEmpty
Gets whether this handler is empty (no callbacks set). An empty handler indicates the drag was rejected and should not be captured.
Returns: Boolean
public bool IsEmpty { get; }OnEnd
Called when the drag ends (mouse button released).
Returns: Action<InputBindingActionContext>
public Action<InputBindingActionContext>? OnEnd { get; }OnMove
Called when the mouse moves during the drag. Parameters are (context, deltaX, deltaY) where delta is from the drag start position.
Returns: Action<InputBindingActionContext, Int32, Int32>
public Action<InputBindingActionContext, int, int>? OnMove { get; }Methods
Simple(Action<int, int>?, Action?)
Creates a new drag handler with simple callbacks (no context). For backwards compatibility with existing code.
Parameters:
onMove(Action<Int32, Int32>): Called during drag with (deltaX, deltaY).onEnd(Action): Called when drag ends.
Returns: DragHandler
public static DragHandler Simple(Action<int, int>? onMove = null, Action? onEnd = null)