Class TerminalCommandInput
- Namespace
- RatatuiUnity
A reusable command-line input built on top of TerminalInput. Adds the keystrokes a console/REPL needs (Enter/Escape/Tab/Up/Down) as events, while delegating editing (typing, selection, clipboard, undo/redo, horizontal scroll, mobile IME) to the underlying widget.
Composition rather than inheritance: TerminalInput methods are not virtual, but its public API is rich enough that a wrapper can drive it.
public class TerminalCommandInput
- Inheritance
-
TerminalCommandInput
- Inherited Members
Properties
Cursor
public int Cursor { get; set; }
Property Value
HasSelection
public bool HasSelection { get; }
Property Value
Input
public TerminalInput Input { get; }
Property Value
Placeholder
public string Placeholder { get; set; }
Property Value
Prefix
public string Prefix { get; set; }
Property Value
PrefixBg
public Color PrefixBg { get; set; }
Property Value
- Color
PrefixFg
public Color PrefixFg { get; set; }
Property Value
- Color
ReadOnly
public bool ReadOnly { get; set; }
Property Value
Text
public string Text { get; set; }
Property Value
Methods
HandleKeyEvent(TerminalKeyEvent)
public bool HandleKeyEvent(TerminalKeyEvent e)
Parameters
Returns
HandleMouseEvent(TerminalMouseEvent)
public bool HandleMouseEvent(TerminalMouseEvent e)
Parameters
Returns
OnBlur()
public void OnBlur()
OnFocus()
public void OnFocus()
Render(RatatuiTerminal, uint, Color, Color, Color, Color, Color, Color, Color, bool)
public void Render(RatatuiTerminal term, uint areaId, Color fg = default, Color bg = default, Color cursorFg = default, Color cursorBg = default, Color selectionFg = default, Color selectionBg = default, Color placeholderFg = default, bool focused = true)
Parameters
termRatatuiTerminalareaIduintfgColorbgColorcursorFgColorcursorBgColorselectionFgColorselectionBgColorplaceholderFgColorfocusedbool
Events
OnEdit
Fires whenever a key event mutated Text. Useful for resetting external history-search state on any kind of edit (typing, paste, cut, undo, delete-word, …) without enumerating individual keys.
public event Action OnEdit
Event Type
OnEscape
Escape pressed. The wrapper consumes the key.
public event Action OnEscape
Event Type
OnHistoryStep
UpArrow → -1, DownArrow → +1. Only fires when no modifier is held so Cmd/Ctrl-modified arrows fall through to TerminalInput.
public event Action<int> OnHistoryStep
Event Type
OnShiftTab
Shift+Tab pressed. Consumed only if a handler is attached.
public event Action OnShiftTab
Event Type
OnSubmit
Enter or KeypadEnter pressed. The wrapper consumes the key.
public event Action OnSubmit
Event Type
OnTab
Tab pressed (no Shift). Consumed only if a handler is attached.
public event Action OnTab