Class InputCoordinator
- Namespace
- SharpConsoleUI.Input
- Assembly
- SharpConsoleUI.dll
Coordinates all input processing for the console window system. Handles keyboard input, mouse events, window dragging, and resizing operations. Extracted from ConsoleWindowSystem to reduce complexity and improve maintainability.
public class InputCoordinator
- Inheritance
-
InputCoordinator
- Inherited Members
Constructors
InputCoordinator(IConsoleDriver, InputStateService, WindowStateService, ILogService, ConsoleWindowSystem)
Initializes a new instance of the InputCoordinator class.
public InputCoordinator(IConsoleDriver consoleDriver, InputStateService inputStateService, WindowStateService windowStateService, ILogService logService, ConsoleWindowSystem context)
Parameters
consoleDriverIConsoleDriverConsole driver for event subscription.
inputStateServiceInputStateServiceService managing keyboard input state.
windowStateServiceWindowStateServiceService managing window drag/resize state.
logServiceILogServiceLogging service for debug output.
contextConsoleWindowSystemWindow system context for operations requiring access to window collection and rendering.
Methods
ProcessInput()
Processes all pending keyboard input from the input queue. Routes input to appropriate handlers based on key combinations and active window state.
public void ProcessInput()
RegisterEventHandlers(EventHandler<ConsoleKeyInfo>)
Registers event handlers for mouse and keyboard input. Must be called after ConsoleWindowSystem initialization.
public void RegisterEventHandlers(EventHandler<ConsoleKeyInfo> keyPressedHandler)
Parameters
keyPressedHandlerEventHandler<ConsoleKeyInfo>
UnregisterEventHandlers(EventHandler<ConsoleKeyInfo>)
Unregisters event handlers for mouse and keyboard input. Must be called during ConsoleWindowSystem cleanup.
public void UnregisterEventHandlers(EventHandler<ConsoleKeyInfo> keyPressedHandler)
Parameters
keyPressedHandlerEventHandler<ConsoleKeyInfo>