Skip to content

Class UISurfaceProgram

Runs an interface as a surface program: it draws straight into the session’s cell surface and takes input as events, with no escape sequences either way. Start it with TerminalSession.RunSurface.

Declaration
public sealed class UISurfaceProgram : ISurfaceProgram, ISurfaceSlots, ITerminalInput

Implements:
DarkEffekt.Terminal.ISurfaceProgram, DarkEffekt.Terminal.ISurfaceSlots, DarkEffekt.Terminal.ITerminalInput

Declaration
public TerminalUI UI { get; }
Declaration
public void Start(ISurfaceHost host)
Type Name
DarkEffekt.Terminal.ISurfaceHost host
Declaration
public void Stop()

Called once a frame, before the session draws. Draw here, then call Invalidate on the surface.

Declaration
public void Tick(float deltaSeconds)
Type Name
System.Single deltaSeconds

The surface was resized and blanked.

Declaration
public void OnResize(int cols, int rows)
Type Name
System.Int32 cols
System.Int32 rows

Adds the slots visible this frame to the list.

Declaration
public void GetSlots(List<SurfaceSlot> into)
Type Name
System.Collections.Generic.List<DarkEffekt.Terminal.SurfaceSlot> into

A texture was bound to a slot name, or removed from it.

Declaration
public void SlotBound(string name, bool bound)
Type Name
System.String name
System.Boolean bound

A non-text key: arrows, function keys, Enter, Tab, and the rest of DarkEffekt.Terminal.TermKey.

Declaration
public void OnKey(in TermKeyEvent e)
Type Name
DarkEffekt.Terminal.TermKeyEvent e

A typed character, or a letter held with Ctrl or Alt.

Declaration
public void OnChar(char c, TermModifiers modifiers)
Type Name
System.Char c
DarkEffekt.Terminal.TermModifiers modifiers

Text pasted from the clipboard.

Declaration
public void OnPaste(string text)
Type Name
System.String text
Declaration
public void OnMouse(in TermMouseEvent e)
Type Name
DarkEffekt.Terminal.TermMouseEvent e

The terminal gained or lost keyboard focus.

Declaration
public void OnFocus(bool focused)
Type Name
System.Boolean focused