namespace Terminal.Gui.Drivers;
///
/// Interface for main loop class that will process the queued input.
/// Is responsible for and translating into common Terminal.Gui
/// events and data models.
///
public interface IInputProcessor
{
/// Event raised when a terminal sequence read from input is not recognized and therefore ignored.
public event EventHandler? AnsiSequenceSwallowed;
///
/// Gets the name of the driver associated with this input processor.
///
string? DriverName { get; init; }
///
/// Drains the input queue, processing all available keystrokes. To be called on the main loop thread.
///
void ProcessQueue ();
///
/// Gets the response parser currently configured on this input processor.
///
///
public IAnsiResponseParser GetParser ();
///
/// Handles surrogate pairs in the input stream.
///
/// The key from input.
/// Get the surrogate pair or the key.
///
/// if the result is a valid surrogate pair or a valid key, otherwise
/// .
///
bool IsValidInput (Key key, out Key result);
///
/// Called when a key down event has been dequeued. Raises the event. This is a precursor to
/// .
///
/// The key event data.
void RaiseKeyDownEvent (Key key);
/// Event raised when a key down event has been dequeued. This is a precursor to .
event EventHandler? KeyDown;
///
/// Adds a key up event to the input queue. For unit tests.
///
///
void EnqueueKeyDownEvent (Key key);
///
/// Called when a key up event has been dequeued. Raises the event.
///
///
/// Drivers that do not support key release events will call this method after
/// processing
/// is complete.
///
/// The key event data.
void RaiseKeyUpEvent (Key key);
/// Event raised when a key up event has been dequeued.
///
/// Drivers that do not support key release events will fire this event after processing is
/// complete.
///
event EventHandler? KeyUp;
///
/// Adds a key up event to the input queue. For unit tests.
///
///
void EnqueueKeyUpEvent (Key key);
///
/// Called when a mouse event has been dequeued. Raises the event.
///
/// The mouse event data.
void RaiseMouseEvent (MouseEventArgs mouseEventArgs);
/// Event raised when a mouse event has been dequeued.
event EventHandler? MouseEvent;
///
/// Adds a mouse input event to the input queue. For unit tests.
///
///
/// The application instance to use. Used to use Invoke to raise the mouse
/// event in the case where this method is not called on the main thread.
///
///
void EnqueueMouseEvent (IApplication? app, MouseEventArgs mouseEvent);
}