DragBinding
Namespace: Hex1b.Input
Assembly: Hex1b.dll
A binding that initiates a drag operation on mouse down. The factory is called at drag start and returns a DragHandler that receives subsequent events.
public sealed class DragBindingInheritance
Object → DragBinding
Constructors
DragBinding(MouseButton, Hex1bModifiers, Func<int, int, DragHandler>, string?, ActionId?)
Parameters:
button(MouseButton):modifiers(Hex1bModifiers):factory(Func<Int32, Int32, DragHandler>):description(String):actionId(Nullable<ActionId>):
public DragBinding(MouseButton button, Hex1bModifiers modifiers, Func<int, int, DragHandler> factory, string? description, ActionId? actionId = null)Properties
ActionId
A stable identifier for the action this binding performs. Used for programmatic rebinding via .
Returns: Nullable<ActionId>
public ActionId? ActionId { get; }Button
The mouse button that initiates the drag.
Returns: MouseButton
public MouseButton Button { get; }Description
Human-readable description of what this drag binding does.
Returns: String
public string? Description { get; }Factory
Factory that creates a DragHandler when the drag starts. Receives the local (x, y) coordinates where the drag began.
Returns: Func<Int32, Int32, DragHandler>
public Func<int, int, DragHandler> Factory { get; }Modifiers
Required modifier keys.
Returns: Hex1bModifiers
public Hex1bModifiers Modifiers { get; }Methods
Matches(Hex1bMouseEvent)
Checks if this binding matches the given mouse down event.
Parameters:
mouseEvent(Hex1bMouseEvent):
Returns: Boolean
public bool Matches(Hex1bMouseEvent mouseEvent)StartDrag(int, int)
Starts the drag by invoking the factory with the local coordinates.
Parameters:
Returns: DragHandler
public DragHandler StartDrag(int localX, int localY)