Class ConsoleDriver
Base class for Terminal.Gui ConsoleDriver implementations.
public abstract class ConsoleDriver : IConsoleDriver
- Inheritance
-
ConsoleDriver
- Implements
- Derived
- Inherited Members
Remarks
There are currently four implementations: - Terminal.Gui.CursesDriver (for Unix and Mac) - Terminal.Gui.WindowsDriver - Terminal.Gui.NetDriver that uses the .NET Console API - FakeConsole for unit testing.
Properties
- Clip
Gets or sets the clip rectangle that AddRune(Rune) and AddStr(string) are subject to.
- Clipboard
Get the operating system clipboard.
- Col
Gets the column last set by Move(int, int). Col and Row are used by AddRune(Rune) and AddStr(string) to determine where to add content.
- Cols
The number of columns visible in the terminal.
- Contents
The contents of the application output. The driver outputs this buffer to the terminal when UpdateScreen() is called.
The format of the array is rows, columns. The first index is the row, the second index is the column.
- CurrentAttribute
The Attribute that will be used for the next AddRune(Rune) or AddStr(string) call.
- EscTimeout
How long after Esc has been pressed before we give up on getting an Ansi escape sequence
- Force16Colors
Gets or sets whether the ConsoleDriver should use 16 colors instead of the default TrueColors. See Force16Colors to change this setting via ConfigurationManager.
- Left
The leftmost column in the terminal.
- Row
Gets the row last set by Move(int, int). Col and Row are used by AddRune(Rune) and AddStr(string) to determine where to add content.
- Rows
The number of rows visible in the terminal.
- Screen
Gets the location and size of the terminal screen.
- SupportsTrueColor
Gets whether the ConsoleDriver supports TrueColor output.
- Top
The topmost row in the terminal.
Methods
- AddRune(char)
Adds the specified char to the display at the current cursor position. This method is a convenience method that calls AddRune(Rune) with the Rune constructor.
- AddRune(Rune)
Adds the specified rune to the display at the current cursor position.
- AddStr(string)
Adds the
str
to the display at the cursor position.
- ClearContents()
Clears the Contents of the driver.
- End()
Ends the execution of the console driver.
- FillRect(Rectangle, char)
Fills the specified rectangle with the specified char. This method is a convenience method that calls FillRect(Rectangle, Rune).
- FillRect(Rectangle, Rune)
Fills the specified rectangle with the specified rune, using CurrentAttribute
- GetAttribute()
Gets the current Attribute.
- GetCursorVisibility(out CursorVisibility)
Gets the terminal cursor visibility.
- GetRequestScheduler()
Gets the AnsiRequestScheduler for this ConsoleDriver.
- GetVersionInfo()
Returns the name of the driver and relevant library version information.
- Init()
Initializes the driver
- IsRuneSupported(Rune)
Tests if the specified rune is supported by the driver.
- IsValidLocation(int, int)
Tests whether the specified coordinate are valid for drawing.
- IsValidLocation(Rune, int, int)
Tests whether the specified coordinate are valid for drawing the specified Rune.
- MakeColor(in Color, in Color)
Makes an Attribute.
- Move(int, int)
Updates Col and Row to the specified column and row in Contents. Used by AddRune(Rune) and AddStr(string) to determine where to add content.
- OnKeyDown(Key)
Called when a key is pressed down. Fires the KeyDown event. This is a precursor to OnKeyUp(Key).
- OnKeyUp(Key)
Called when a key is released. Fires the KeyUp event.
- OnMouseEvent(MouseEventArgs)
Called when a mouse event occurs. Fires the MouseEvent event.
- OnSizeChanged(SizeChangedEventArgs)
Called when the terminal size changes. Fires the SizeChanged event.
- QueueAnsiRequest(AnsiEscapeSequenceRequest)
Queues the given
request
for execution
- Refresh()
Updates the screen to reflect all the changes that have been done to the display buffer
- SendKeys(char, ConsoleKey, bool, bool, bool)
Simulates a key press.
- SetAttribute(Attribute)
Selects the specified attribute as the attribute to use for future calls to AddRune and AddString.
- SetContentsAsDirty()
Sets Contents as dirty for situations where views don't need layout and redrawing, but just refresh the screen.
- SetCursorVisibility(CursorVisibility)
Sets the terminal cursor visibility.
- Suspend()
Suspends the application (e.g. on Linux via SIGTSTP) and upon resume, resets the console driver.
- UpdateScreen()
Redraws the physical screen with the contents that have been queued up via any of the printing commands.
- WriteRaw(string)
Provide proper writing to send escape sequence recognized by the ConsoleDriver.
Events
- ClearedContents
Raised each time ClearContents() is called. For benchmarking.
- KeyUp
Event fired when a key is released.
- MouseEvent
Event fired when a mouse event occurs.
- SizeChanged
The event fired when the terminal is resized.