|
TachyonUI 1.1.0
High-performance UI for building tools.
|
Input state, handlers, commands, shortcuts and undo history. More...
Classes | |
| struct | tachyon::CommandID |
| Handle to a registered command, stable for the manager's lifetime. More... | |
| class | tachyon::CommandManager |
| Registry of commands: named actions with an optional icon and an optional shortcut key, each firing one callback when invoked (clicked from a menu / toolbar, or via its key). More... | |
| struct | tachyon::PressOptions |
| What a press does besides being tracked. More... | |
| struct | tachyon::NoSnapshot |
| No value to keep: a press that changes nothing to put back. More... | |
| struct | tachyon::Gesture< Snapshot > |
| One press that may become a drag, with what every control does around it: the focus and the capture on the press, the value the drag changes kept as it was, put back on Escape and left for the commit after the release. More... | |
| struct | tachyon::HoverPart< Part > |
| The part of a drawn control under the pointer (a key, a handle, a clip's end), for its hover look. More... | |
| class | tachyon::InputHandlerBroadcaster |
| Sends every platform input event to all handlers (e.g. More... | |
| struct | tachyon::ElementEvent |
| An input event delivered to an element's EventHandler. More... | |
| struct | tachyon::RecordedInputEvent |
| A single OS input event recorded for dispatch this frame. More... | |
| class | tachyon::InputManager |
| Receives raw OS events, records them, and runs the frame's input pipeline (tab navigation, text editor focus, dispatch, post-dispatch). More... | |
| struct | tachyon::PenState |
| The pen, as it was at a pointer event. More... | |
| struct | tachyon::InputState |
| Snapshot of input state for a single recorded OS event. More... | |
| struct | tachyon::FileDrag |
| A drag from another application, of files or text, over one of the app's windows. More... | |
| struct | tachyon::FileDrop |
| Files or text dropped from another application. More... | |
| struct | tachyon::WheelNavigation |
| What a wheel or pinch event asks of a canvas. More... | |
| class | tachyon::IPlatformInputHandler |
| Platform-level input interface: receives raw OS events (keyboard, mouse) and forwards them into the GUI input pipeline. More... | |
| struct | tachyon::PointerDrag |
| One press on an element that may become a drag. More... | |
| class | tachyon::UndoHistory |
| The app's undo history: steps that each undo and redo one change. More... | |
Typedefs | |
| using | tachyon::EventHandler = std::function<bool(ElementEvent&& input)> |
| Element-level input handler used by the immediate-mode dispatcher; returns true when it consumed the event. | |
Functions | |
| void | tachyon::TakeFocus (GUIStateManager &gsm, ID element) |
| A press focuses element: the keyboard goes to it, and a text editor that had it lets go. | |
| template<class... Presses> | |
| bool | tachyon::AnyHeld (const Presses &... presses) noexcept |
| Whether any of a control's presses is held: its hover parts stay as they are then. | |
| float | tachyon::DoubleClickMilliseconds () noexcept |
| The most time between the two clicks of a double-click, milliseconds: the OS's setting, which the application reads from its window backend every frame. | |
| void | tachyon::SetDoubleClickMilliseconds (float milliseconds) noexcept |
| Sets DoubleClickMilliseconds; values of 0 or less are ignored. | |
| EventHandler | tachyon::Chain (EventHandler first, EventHandler second) |
| A handler that tries first, then second when first returns false. | |
| constexpr WheelMode | tachyon::DefaultWheelMode () |
| The mode a platform's users expect: Pan on macOS, where most pointers are trackpads; Zoom elsewhere. | |
| WheelNavigation | tachyon::NavigateByWheel (const InputState &s, WheelMode mode, float zoomStep) |
| A wheel (or pinch) event's zoom or scroll by mode; zoomStep is the zoom of one notch. | |
| MouseButtons | tachyon::PanDragButton (const InputState &s) |
| The button a press drags the view with: the middle one, or the left with Alt for a mouse or trackpad without a middle button. | |
| constexpr bool | tachyon::IsDragTravel (int2 delta, int32_t distance) noexcept |
| Whether the pointer moving delta pixels from a press makes it a drag: distance pixels or more in a straight line. | |
| constexpr bool | tachyon::IsDragCancelKey (const InputState &s) noexcept |
| Escape going down: cancels the drag of the element that has the event. | |
Variables | |
| constexpr float | tachyon::kWheelScrollStep = 30.0f |
| scrolled per wheel notch (CSS px) | |
| constexpr int32_t | tachyon::kDragStartDistance = 4 |
| pointer travel before a press becomes a drag (CSS px) | |
| constexpr float | tachyon::kDefaultDoubleClickMs = 500.0f |
| The OS's double-click time if the platform reports one, else this, milliseconds. | |
Input state, handlers, commands, shortcuts and undo history.
| using tachyon::EventHandler = std::function<bool(ElementEvent&& input)> |
#include <gui_core/input/gui_input_handler_func.h>
Element-level input handler used by the immediate-mode dispatcher; returns true when it consumed the event.
|
strong |
#include <gui_core/input/gui_command_manager.h>
A set of shortcuts that is active while the app says so (e.g.
a node view's while it has the focus). Opaque: other values come from CommandManager::RegisterMode. Default is always registered and is the fallback when the active mode has no matching command.
| Enumerator | |
|---|---|
| Default | |
|
strong |
#include <gui_core/input/gui_gesture.h>
Where a press is, nested in the element's hover: nothing held, held, or dragging.
| Enumerator | |
|---|---|
| Idle | no press |
| Pressed | held, not yet moved the drag distance: may still be a click |
| Dragging | held and moved the drag distance (or a drag from the press on) |
|
strong |
#include <gui_core/input/gui_input_enums.h>
Modifier keys held, combined with |.
The Alt key reports as Option on macOS; Command is the Cmd key there and the Windows or Super key elsewhere.
| Enumerator | |
|---|---|
| None | |
| Shift | |
| Control | |
| Alt | |
| Option | |
| Command | |
|
strong |
#include <gui_core/input/gui_input_enums.h>
Mouse buttons, combined with |.
| Enumerator | |
|---|---|
| None | |
| Left | |
| Middle | |
| Right | |
| X1 | |
| X2 | |
|
strong |
#include <gui_core/input/gui_input_enums.h>
A keyboard event: a key down or up, or a typed character (KeyChar).
| Enumerator | |
|---|---|
| KeyDown | |
| KeyUp | |
| KeyChar | |
|
strong |
#include <gui_core/input/gui_input_enums.h>
Whether a mouse button went down or up.
| Enumerator | |
|---|---|
| MouseDown | |
| MouseUp | |
|
strong |
#include <gui_core/input/gui_input_enums.h>
A step of a drag from another application (files, text) over one of the app's windows.
|
strong |
#include <gui_core/input/gui_input_enums.h>
The kind of input event the GUI dispatches to element handlers.
|
strong |
#include <gui_core/input/gui_input_enums.h>
Keys by what the keyboard layout makes them, not by position.
KeyAction::KeyChar events carry a Unicode codepoint in this type instead.
|
strong |
#include <gui_core/input/gui_input_state.h>
What moves the pointer.
| Enumerator | |
|---|---|
| Mouse | |
| Pen | a pen on a tablet or a pen display |
|
strong |
#include <gui_core/input/gui_input_state.h>
A pen's axes, in the order PenState::SetAxis takes them.
| Enumerator | |
|---|---|
| Pressure | |
| TiltX | |
| TiltY | |
| Distance | |
| Rotation | |
| Slider | |
| TangentialPressure | |
| Count | |
|
strong |
#include <gui_core/input/gui_navigation.h>
What the wheel, and a trackpad's two-finger scroll, does over such a canvas.
A trackpad's scroll reaches the app as wheel turns, so with Pan a trackpad scrolls the view as it would a page.
| Enumerator | |
|---|---|
| Zoom | the wheel zooms round the pointer; Shift+wheel scrolls sideways |
| Pan | the wheel scrolls the view (Shift: sideways); Ctrl+wheel zooms |
| void tachyon::TakeFocus | ( | GUIStateManager & | gsm, |
| ID | element ) |
#include <gui_core/input/gui_gesture.h>
A press focuses element: the keyboard goes to it, and a text editor that had it lets go.
|
noexcept |
#include <gui_core/input/gui_gesture.h>
Whether any of a control's presses is held: its hover parts stay as they are then.
|
noexcept |
#include <gui_core/input/gui_input_enums.h>
The most time between the two clicks of a double-click, milliseconds: the OS's setting, which the application reads from its window backend every frame.
|
noexcept |
#include <gui_core/input/gui_input_enums.h>
Sets DoubleClickMilliseconds; values of 0 or less are ignored.
|
inline |
#include <gui_core/input/gui_input_handler_func.h>
A handler that tries first, then second when first returns false.
|
constexpr |
#include <gui_core/input/gui_navigation.h>
The mode a platform's users expect: Pan on macOS, where most pointers are trackpads; Zoom elsewhere.
|
inline |
#include <gui_core/input/gui_navigation.h>
A wheel (or pinch) event's zoom or scroll by mode; zoomStep is the zoom of one notch.
A pinch zooms in either mode. A sideways scroll (a tilt wheel, a trackpad) always scrolls sideways.
|
inline |
#include <gui_core/input/gui_navigation.h>
The button a press drags the view with: the middle one, or the left with Alt for a mouse or trackpad without a middle button.
None when the press isn't one.
|
constexprnoexcept |
#include <gui_core/input/gui_pointer_drag.h>
Whether the pointer moving delta pixels from a press makes it a drag: distance pixels or more in a straight line.
Every press that can be a click or a drag decides with this, at Px(kDragStartDistance).
|
constexprnoexcept |
#include <gui_core/input/gui_pointer_drag.h>
Escape going down: cancels the drag of the element that has the event.
|
constexpr |
#include <gui_core/input/gui_input_enums.h>
scrolled per wheel notch (CSS px)
|
constexpr |
#include <gui_core/input/gui_input_enums.h>
pointer travel before a press becomes a drag (CSS px)
|
constexpr |
#include <gui_core/input/gui_input_enums.h>
The OS's double-click time if the platform reports one, else this, milliseconds.