Class InputProcessorImpl<TInputRecord>
Processes the queued input queue contents - which must be of Type TInputRecord.
Is responsible for ProcessQueue() and translating into common Terminal.Gui
events and data models. Runs on the main loop thread.
public abstract class InputProcessorImpl<TInputRecord> : IInputProcessor, IDisposable where TInputRecord : struct
Type Parameters
TInputRecord
- Inheritance
-
InputProcessorImpl<TInputRecord>
- Implements
- Derived
- Inherited Members
Constructors
- InputProcessorImpl(ConcurrentQueue<TInputRecord>, IKeyConverter<TInputRecord>)
Constructs base instance including wiring all relevant parser events and setting InputQueue to the provided thread safe input collection.
Properties
- DriverName
Gets the name of the driver associated with this input processor.
- InputQueue
The input queue which is filled by IInput<TInputRecord> implementations running on the input thread. Implementations of this class should dequeue from this queue in ProcessQueue() on the main loop thread.
- KeyConverter
Class responsible for translating the driver specific native input class
TInputRecorde.g. ConsoleKeyInfo into the Terminal.Gui Key class (used for all internal library representations of Keys).
Methods
- Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
- EnqueueKeyDownEvent(Key)
Adds a key up event to the input queue. For unit tests.
- EnqueueKeyUpEvent(Key)
Adds a key up event to the input queue. For unit tests.
- EnqueueMouseEvent(MouseEventArgs)
Adds a mouse input event to the input queue. For unit tests.
- GetParser()
Gets the response parser currently configured on this input processor.
- IsValidInput(Key, out Key)
Handles surrogate pairs in the input stream.
- Process(TInputRecord)
Process the provided single input element
input. This method is called sequentially for each value read from InputQueue.
- ProcessAfterParsing(TInputRecord)
Process the provided single input element - short-circuiting the Terminal.Gui.Drivers.InputProcessorImpl<TInputRecord>.Parser stage of the processing.
- ProcessQueue()
Drains the input queue, processing all available keystrokes. To be called on the main loop thread.
- RaiseKeyDownEvent(Key)
Called when a key down event has been dequeued. Raises the KeyDown event. This is a precursor to RaiseKeyUpEvent(Key).
- RaiseKeyUpEvent(Key)
Called when a key up event has been dequeued. Raises the KeyUp event.
- RaiseMouseEvent(MouseEventArgs)
Called when a mouse event has been dequeued. Raises the MouseEvent event.
Events
- AnsiSequenceSwallowed
Event raised when a terminal sequence read from input is not recognized and therefore ignored.
- KeyUp
Event raised when a key up event has been dequeued.
- MouseEvent
Event raised when a mouse event has been dequeued.