Interface IInputState
Base interface for all canvas input states. Implements the State Pattern for clean input handling.
public interface IInputState
Properties
IsModal
Gets whether this state blocks other interactions.
bool IsModal { get; }
Property Value
Name
Gets the name of this state for debugging.
string Name { get; }
Property Value
Methods
Enter(InputStateContext)
Called when entering this state.
void Enter(InputStateContext context)
Parameters
contextInputStateContext
Exit(InputStateContext)
Called when exiting this state.
void Exit(InputStateContext context)
Parameters
contextInputStateContext
HandleKeyDown(InputStateContext, KeyEventArgs)
Handles key down events.
StateTransitionResult HandleKeyDown(InputStateContext context, KeyEventArgs e)
Parameters
contextInputStateContexteKeyEventArgs
Returns
HandlePointerMoved(InputStateContext, PointerEventArgs)
Handles pointer moved events.
StateTransitionResult HandlePointerMoved(InputStateContext context, PointerEventArgs e)
Parameters
contextInputStateContextePointerEventArgs
Returns
HandlePointerPressed(InputStateContext, PointerPressedEventArgs, Control?)
Handles pointer pressed events.
StateTransitionResult HandlePointerPressed(InputStateContext context, PointerPressedEventArgs e, Control? source)
Parameters
contextInputStateContextePointerPressedEventArgssourceControl
Returns
HandlePointerReleased(InputStateContext, PointerReleasedEventArgs)
Handles pointer released events.
StateTransitionResult HandlePointerReleased(InputStateContext context, PointerReleasedEventArgs e)
Parameters
contextInputStateContextePointerReleasedEventArgs
Returns
HandlePointerWheel(InputStateContext, PointerWheelEventArgs)
Handles pointer wheel events.
StateTransitionResult HandlePointerWheel(InputStateContext context, PointerWheelEventArgs e)
Parameters
contextInputStateContextePointerWheelEventArgs
Returns
Update(InputStateContext, double)
Called each frame for states that need continuous updates (e.g., animations).
void Update(InputStateContext context, double deltaTime)
Parameters
contextInputStateContextdeltaTimedouble