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.
Assembly: DarkEffekt.Terminal.UI
Section titled “Assembly: DarkEffekt.Terminal.UI”public sealed class UISurfaceProgram : ISurfaceProgram, ISurfaceSlots, ITerminalInputImplements:
DarkEffekt.Terminal.ISurfaceProgram, DarkEffekt.Terminal.ISurfaceSlots, DarkEffekt.Terminal.ITerminalInput
Properties
Section titled “Properties”public TerminalUI UI { get; }Methods
Section titled “Methods”Start(ISurfaceHost)
Section titled “Start(ISurfaceHost)”public void Start(ISurfaceHost host)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
| DarkEffekt.Terminal.ISurfaceHost | host |
Stop()
Section titled “Stop()”public void Stop()Tick(float)
Section titled “Tick(float)”Called once a frame, before the session draws. Draw here, then call Invalidate on the surface.
public void Tick(float deltaSeconds)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Single |
deltaSeconds |
OnResize(int, int)
Section titled “OnResize(int, int)”The surface was resized and blanked.
public void OnResize(int cols, int rows)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Int32 |
cols |
System.Int32 |
rows |
GetSlots(List<SurfaceSlot>)
Section titled “GetSlots(List<SurfaceSlot>)”Adds the slots visible this frame to the list.
public void GetSlots(List<SurfaceSlot> into)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Collections.Generic.List<DarkEffekt.Terminal.SurfaceSlot> |
into |
SlotBound(string, bool)
Section titled “SlotBound(string, bool)”A texture was bound to a slot name, or removed from it.
public void SlotBound(string name, bool bound)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.String |
name |
System.Boolean |
bound |
OnKey(in TermKeyEvent)
Section titled “OnKey(in TermKeyEvent)”A non-text key: arrows, function keys, Enter, Tab, and the rest of DarkEffekt.Terminal.TermKey.
public void OnKey(in TermKeyEvent e)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
| DarkEffekt.Terminal.TermKeyEvent | e |
OnChar(char, TermModifiers)
Section titled “OnChar(char, TermModifiers)”A typed character, or a letter held with Ctrl or Alt.
public void OnChar(char c, TermModifiers modifiers)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Char |
c |
| DarkEffekt.Terminal.TermModifiers | modifiers |
OnPaste(string)
Section titled “OnPaste(string)”Text pasted from the clipboard.
public void OnPaste(string text)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.String |
text |
OnMouse(in TermMouseEvent)
Section titled “OnMouse(in TermMouseEvent)”public void OnMouse(in TermMouseEvent e)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
| DarkEffekt.Terminal.TermMouseEvent | e |
OnFocus(bool)
Section titled “OnFocus(bool)”The terminal gained or lost keyboard focus.
public void OnFocus(bool focused)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Boolean |
focused |