Skip to content

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.

csharp
public sealed class DragHandler

Inheritance

ObjectDragHandler

Constructors

DragHandler(Action<InputBindingActionContext, int, int>?, Action<InputBindingActionContext>?)

Creates a new drag handler with context-aware callbacks.

Parameters:

csharp
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

csharp
public bool IsEmpty { get; }

OnEnd

Called when the drag ends (mouse button released).

Returns: Action<InputBindingActionContext>

csharp
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>

csharp
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:

Returns: DragHandler

csharp
public static DragHandler Simple(Action<int, int>? onMove = null, Action? onEnd = null)

Released under the MIT License.