Table of Contents

Class FakeDriver

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

Implements a mock ConsoleDriver for unit testing

public class FakeDriver : ConsoleDriver
Inheritance
FakeDriver
Inherited Members

Constructors

FakeDriver()

Fields

FakeBehaviors

Properties

Clipboard

Get the operation system clipboard.

Cols

The current number of columns in the terminal.

Contents

Assists with testing, the format is rows, columns and 3 values on the last column: Rune, Attribute and Dirty Flag

EnableConsoleScrolling

If false (the default) the height of the Terminal.Gui application (Rows) tracks to the height of the visible console view when the console is resized. In this case scrolling in the console will be disabled and all Rows will remain visible.

If true then height of the Terminal.Gui application Rows only tracks the height of the visible console view when the console is made larger (the application will only grow in height, never shrink). In this case console scrolling is enabled and the contents (Rows high) will scroll as the console scrolls.

HeightAsBuffer

This API is deprecated and has no impact when enabled.

Left

The current left in the terminal.

Rows

The current number of rows in the terminal.

Top

The current top in the terminal.

Methods

AddRune(Rune)

Adds the specified rune to the display at the current cursor position.

AddStr(ustring)

Adds the str to the display at the cursor position.

CookMouse()

Enables the cooked event processing from the mouse driver. Not implemented by any driver: See Issue #2300.

End()

Ends the execution of the console driver.

EnsureCursorVisibility()

Ensure the cursor visibility

FromVKPacketToKConsoleKeyInfo(ConsoleKeyInfo)
GetColors(int, out Color, out Color)

Gets the foreground and background colors based on the value.

GetCursorVisibility(out CursorVisibility)

Retreive the cursor caret visibility

Init(Action)

Initializes the driver

MakeAttribute(Color, Color)

Make the attribute for the foreground and background colors.

MakeColor(Color, Color)

Make the Colors for the ColorScheme.

Move(int, int)

Moves the cursor to the specified column and row.

PrepareToRun(MainLoop, Action<KeyEvent>, Action<KeyEvent>, Action<KeyEvent>, Action<MouseEvent>)

Prepare the driver and set the key and mouse events handlers.

Refresh()

Updates the screen to reflect all the changes that have been done to the display buffer

ResizeScreen()

Resizes the clip area when the screen is resized.

SendKeys(char, ConsoleKey, bool, bool, bool)

Allows sending keys without typing on a keyboard.

SetAttribute(Attribute)

Selects the specified attribute as the attribute to use for future calls to AddRune and AddString.

SetBufferSize(int, int)
SetColors(ConsoleColor, ConsoleColor)

Set Colors from limit sets of colors. Not implemented by any driver: See Issue #2300.

SetColors(short, short)

Advanced uses - set colors to any pre-set pairs, you would need to init_color that independently with the R, G, B values. Not implemented by any driver: See Issue #2300.

SetCursorVisibility(CursorVisibility)

Change the cursor caret visibility

SetWindowPosition(int, int)
SetWindowSize(int, int)
StartReportingMouseMoves()

Start of mouse moves.

StopReportingMouseMoves()

Stop reporting mouses moves.

Suspend()

Suspend the application, typically needs to save the state, suspend the app and upon return, reset the console driver.

UncookMouse()

Disables the cooked event processing from the mouse driver. At startup, it is assumed mouse events are cooked. Not implemented by any driver: See Issue #2300.

UpdateCursor()

Updates the location of the cursor position

UpdateOffScreen()

Reset and recreate the contents and the driver buffer.

UpdateScreen()

Redraws the physical screen with the contents that have been queued up via any of the printing commands.