Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Rikitav/Terminality/llms.txt

Use this file to discover all available pages before exploring further.

Terminality’s layout and input subsystems are controlled through a set of scoped enumerations. HorizontalAlign, VerticalAlign, TextWrap, TextAlign, and Orientation come from terminality:Layout; Direction comes from terminality:Focus; InputKey and InputModifier come from terminality:InputEvent. Together they cover every axis of positioning, content flow, keyboard routing, and input handling available in the framework.

HorizontalAlign

Controls how a control positions itself (or its children) along the horizontal axis. Assigned to the HorizontalAlignment property on any ControlBase-derived class.
EnumeratorDescription
HorizontalAlign::LeftSnap to the left edge of the available space. Width is determined by the control’s measured size.
HorizontalAlign::CenterCenter horizontally. Width is determined by the control’s measured size.
HorizontalAlign::RightSnap to the right edge. Width is determined by the control’s measured size.
HorizontalAlign::StretchFill the entire available width. The control’s measured width is ignored.
label->HorizontalAlignment = HorizontalAlign::Stretch;
grid->HorizontalAlignment  = HorizontalAlign::Left;

VerticalAlign

Controls how a control positions itself along the vertical axis. Assigned to the VerticalAlignment property.
EnumeratorDescription
VerticalAlign::TopSnap to the top edge. Height is determined by the control’s measured size.
VerticalAlign::CenterCenter vertically. Height is determined by the control’s measured size.
VerticalAlign::BottomSnap to the bottom edge. Height is determined by the control’s measured size.
VerticalAlign::StretchFill the entire available height. The control’s measured height is ignored.
button->VerticalAlignment = VerticalAlign::Top;
panel->VerticalAlignment  = VerticalAlign::Stretch;

TextWrap

Specifies how a Label breaks its text when it is wider than the available column count. Assigned to Label::TextWrapping.
EnumeratorDescription
TextWrap::NoWrapText is never broken; characters that exceed the width are clipped.
TextWrap::WrapBreak at any character boundary once the line is full.
TextWrap::WrapWholeWordsBreak only at whitespace, keeping whole words together. Falls back to character wrapping if a single word is wider than the available space.

TextAlign

Specifies horizontal text alignment within the label’s bounding box. Assigned to Label::TextAlignment.
EnumeratorDescription
TextAlign::LeftText is left-aligned (ragged right).
TextAlign::CenterEach line is centered within the available width.
TextAlign::RightText is right-aligned (ragged left).
TextAlign::JustifySpaces between words are expanded so each full line reaches both edges. The final line of a paragraph is left-aligned.

Orientation

Determines the primary axis along which a StackPanel (or any panel that has an orientation) lays out its children. Assigned to StackPanel::ContentOrientation.
EnumeratorDescription
Orientation::VerticalChildren are stacked top-to-bottom. Each child occupies its full measured height.
Orientation::HorizontalChildren are placed left-to-right. Each child occupies its full measured width.
stackPanel->ContentOrientation = Orientation::Horizontal;

Direction

Describes a focus-traversal direction. Used by the focus manager when the user navigates between focusable controls.
EnumeratorTriggerDescription
Direction::UpUp arrowMove focus to the nearest focusable control above.
Direction::DownDown arrowMove focus to the nearest focusable control below.
Direction::LeftLeft arrowMove focus to the nearest focusable control to the left.
Direction::RightRight arrowMove focus to the nearest focusable control to the right.
Direction::NextTabAdvance focus to the next focusable control in document order.
Direction::PreviousShift + TabMove focus to the previous focusable control in document order.

InputKey

InputKey is a scoped enum whose values correspond to Windows Virtual Key codes, making the mapping unambiguous on Win32. The framework maps platform-specific scan codes to these values before dispatching InputEvent to controls.

Common keys

EnumeratorHexDescription
InputKey::None-1No key / timeout sentinel.
InputKey::BACK0x08Backspace.
InputKey::TAB0x09Tab.
InputKey::RETURN0x0DEnter / Return.
InputKey::ESCAPE0x1BEscape.
InputKey::SPACE0x20Spacebar.
InputKey::PRIOR0x21Page Up.
InputKey::NEXT0x22Page Down.
InputKey::END0x23End.
InputKey::HOME0x24Home.
InputKey::LEFT0x25Left arrow.
InputKey::UP0x26Up arrow.
InputKey::RIGHT0x27Right arrow.
InputKey::DOWN0x28Down arrow.
InputKey::INSERT0x2DInsert.
InputKey::DELETE0x2EDelete.

Alphanumeric keys

Digit keys run from InputKey::NUM0 (0x30) through InputKey::NUM9 (0x39). Letter keys run from InputKey::A (0x41) through InputKey::Z (0x5A).

Numpad keys

Numpad digits run from InputKey::NUMPAD0 (0x60) through InputKey::NUMPAD9 (0x69). Arithmetic operators are MULTIPLY (0x6A), ADD (0x6B), SUBTRACT (0x6D), DECIMAL (0x6E), and DIVIDE (0x6F).

Function keys

InputKey::F1 (0x70) through InputKey::F24 (0x87).

Mouse buttons

EnumeratorHexDescription
InputKey::LBUTTON0x01Left mouse button.
InputKey::RBUTTON0x02Right mouse button.
InputKey::MBUTTON0x04Middle mouse button.
InputKey::XBUTTON10x05X1 side button.
InputKey::XBUTTON20x06X2 side button.

Special sentinel

InputKey::CHAR (0xFC) is set internally when a printable Unicode character arrives rather than a virtual key. In that case InputEvent::Char holds the wchar_t value.

InputModifier

A bitmask enum that describes which modifier keys were held when an InputEvent was generated. You combine values with operator| and test them with hasFlag<InputModifier>().
EnumeratorBitDescription
InputModifier::None0No modifiers.
InputModifier::LeftAlt1 << 0Left Alt held.
InputModifier::RightAlt1 << 1Right Alt held.
InputModifier::AltLeftAlt|RightAltEither Alt key held.
InputModifier::LeftCtrl1 << 2Left Ctrl held.
InputModifier::RightCtrl1 << 3Right Ctrl held.
InputModifier::CtrlLeftCtrl|RightCtrlEither Ctrl key held.
InputModifier::Shift1 << 4Shift held.
InputModifier::NumLockOn1 << 5Num Lock is active.
InputModifier::ScrollLockOn1 << 6Scroll Lock is active.
InputModifier::CapsLockOn1 << 7Caps Lock is active.
InputModifier::Special1 << 8Platform-specific extended key flag.
operator| and operator& are provided as constexpr free functions, so you can compose modifiers without a cast:
// Register a hotkey for Ctrl+Shift+D
OnHotkey(InputModifier::Ctrl | InputModifier::Shift, InputKey::D, [](ControlBase* self)
{
    // handler body
});

// Test whether Ctrl was held in an event handler
if (hasFlag(event.Modifier, InputModifier::Ctrl))
{
    // ...
}
From the test application, registering a plain key with no modifiers looks like this:
OnHotkey(InputModifier::None, InputKey::ESCAPE, [](ControlBase* self)
{
    HostApplication::Current().RequestStop();
});

OnHotkey(InputModifier::None, InputKey::RETURN, [&](ControlBase* self)
{
    TextBox* box = static_cast<TextBox*>(self);
    chatHistory_.push_back(MessageModel{ true, L"[now]", box->Text });
    box->Text = L"";
});

Build docs developers (and LLMs) love