TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::InputManager Class Reference

Receives raw OS events, records them, and runs the frame's input pipeline (tab navigation, text editor focus, dispatch, post-dispatch). More...

#include <gui_core/input/gui_input_manager.h>

Inheritance diagram for tachyon::InputManager:

Public Member Functions

 InputManager ()=default
 ~InputManager ()=default
const FileDrag * GetFileDrag () const
 The drag from another application over one of the app's windows now; null when there's none.
std::vector< FileDrop > TakeFileDrops ()
 The drops from other applications since the last call, oldest first.
void PushGlobalHandler (EventHandler h)
 Pushes a global handler.
bool PopGlobalHandler ()
 Pops the last pushed global handler; false when there is none.
void ConsumeKey ()
 Marks the most recently recorded keyboard event as consumed, so Dispatch skips it.
const std::vector< RecordedInputEvent > & GetRecordedEvents () const
 This frame's recorded events, e.g. to read them before Process.
void ConsumeEvent (size_t index)
 Marks recorded event index as consumed, for something that acted on it while building.
MouseButtons GetCurrentButtons () const
 Mouse buttons held as of the last recorded button event.
bool IsDragAbandoned (MouseButtons button=MouseButtons::Left) const
 Whether a drag held with button was left behind: the button is up and no release is queued for this frame.
void UpdatePreHover (GUIStateManager &guiStateManager)
 Updates the drag position from the latest recorded mouse event; call before hover resolution and GUIStateManager::EndFrame.
void SynthesizeMissingMouseEvents (int2 screenPos, MouseButtons lastPhysicalButtons, MouseButtons physicalButtons)
 Detects mouse button presses the OS swallowed (e.g.
void Process (GUIStateManager &guiStateManager, ElementStorage &elementStorage, TabChainManager &tabChainManager, ITextSystem *textSystem, ID overID)
 Per-frame input processing: tab navigation, text editor focus, dispatch to element handlers, and post-dispatch state updates.
void Dispatch (GUIStateManager &guiStateManager, ElementStorage &storage)
 Dispatches each recorded event to elements by capture / focus / hover rules, then clears the events.
Public Member Functions inherited from tachyon::IPlatformInputHandler
virtual ~IPlatformInputHandler ()=default
void OnKeyboard (tachyon::ID windowId, KeyCode key, int repeat, KeyModifier modifiers, KeyAction action) override
 IPlatformInputHandler: record OS events for this frame's dispatch.
void OnMouseMove (tachyon::ID windowId, tachyon::int2 screenPos, tachyon::MouseButtons buttons, KeyModifier modifiers) override
 IPlatformInputHandler: record OS events for this frame's dispatch.
void OnMouseButton (tachyon::ID windowId, tachyon::int2 screenPos, tachyon::MouseButtons buttons, KeyModifier modifiers, MouseAction action) override
 IPlatformInputHandler: record OS events for this frame's dispatch.
void OnMouseScroll (tachyon::ID windowId, tachyon::int2 screenPos, tachyon::float2 scrollOffset, KeyModifier modifiers) override
 IPlatformInputHandler: record OS events for this frame's dispatch.
void OnTextComposition (tachyon::ID, std::string_view, int32_t) override
 IPlatformInputHandler: record OS events for this frame's dispatch.
void OnFileDrop (tachyon::ID windowId, tachyon::int2 screenPos, FileDropAction action, std::string_view data) override
 IPlatformInputHandler: record OS events for this frame's dispatch.

Detailed Description

Receives raw OS events, records them, and runs the frame's input pipeline (tab navigation, text editor focus, dispatch, post-dispatch).

Constructor & Destructor Documentation

◆ InputManager()

tachyon::InputManager::InputManager ( )
default

◆ ~InputManager()

tachyon::InputManager::~InputManager ( )
default

Member Function Documentation

◆ OnKeyboard()

void tachyon::InputManager::OnKeyboard ( tachyon::ID windowId,
KeyCode key,
int repeat,
KeyModifier modifiers,
KeyAction action )
overridevirtual

IPlatformInputHandler: record OS events for this frame's dispatch.

Implements tachyon::IPlatformInputHandler.

◆ OnMouseMove()

void tachyon::InputManager::OnMouseMove ( tachyon::ID windowId,
tachyon::int2 screenPos,
tachyon::MouseButtons buttons,
KeyModifier modifiers )
overridevirtual

IPlatformInputHandler: record OS events for this frame's dispatch.

Implements tachyon::IPlatformInputHandler.

◆ OnMouseButton()

void tachyon::InputManager::OnMouseButton ( tachyon::ID windowId,
tachyon::int2 screenPos,
tachyon::MouseButtons buttons,
KeyModifier modifiers,
MouseAction action )
overridevirtual

IPlatformInputHandler: record OS events for this frame's dispatch.

Implements tachyon::IPlatformInputHandler.

◆ OnMouseScroll()

void tachyon::InputManager::OnMouseScroll ( tachyon::ID windowId,
tachyon::int2 screenPos,
tachyon::float2 scrollOffset,
KeyModifier modifiers )
overridevirtual

IPlatformInputHandler: record OS events for this frame's dispatch.

Implements tachyon::IPlatformInputHandler.

◆ OnTextComposition()

void tachyon::InputManager::OnTextComposition ( tachyon::ID ,
std::string_view ,
int32_t  )
inlineoverridevirtual

IPlatformInputHandler: record OS events for this frame's dispatch.

Implements tachyon::IPlatformInputHandler.

◆ OnFileDrop()

void tachyon::InputManager::OnFileDrop ( tachyon::ID windowId,
tachyon::int2 screenPos,
FileDropAction action,
std::string_view data )
overridevirtual

IPlatformInputHandler: record OS events for this frame's dispatch.

Reimplemented from tachyon::IPlatformInputHandler.

◆ GetFileDrag()

const FileDrag * tachyon::InputManager::GetFileDrag ( ) const
inline

The drag from another application over one of the app's windows now; null when there's none.

◆ TakeFileDrops()

std::vector< FileDrop > tachyon::InputManager::TakeFileDrops ( )
inline

The drops from other applications since the last call, oldest first.

A drag that left without dropping anything isn't one.

◆ PushGlobalHandler()

void tachyon::InputManager::PushGlobalHandler ( EventHandler h)
inline

Pushes a global handler.

Global handlers are tried last-pushed first, after element-level handlers had a chance to consume the input.

◆ PopGlobalHandler()

bool tachyon::InputManager::PopGlobalHandler ( )
inline

Pops the last pushed global handler; false when there is none.

◆ ConsumeKey()

void tachyon::InputManager::ConsumeKey ( )

Marks the most recently recorded keyboard event as consumed, so Dispatch skips it.

◆ GetRecordedEvents()

const std::vector< RecordedInputEvent > & tachyon::InputManager::GetRecordedEvents ( ) const
inline

This frame's recorded events, e.g. to read them before Process.

◆ ConsumeEvent()

void tachyon::InputManager::ConsumeEvent ( size_t index)
inline

Marks recorded event index as consumed, for something that acted on it while building.

◆ GetCurrentButtons()

MouseButtons tachyon::InputManager::GetCurrentButtons ( ) const
inline

Mouse buttons held as of the last recorded button event.

◆ IsDragAbandoned()

bool tachyon::InputManager::IsDragAbandoned ( MouseButtons button = MouseButtons::Left) const

Whether a drag held with button was left behind: the button is up and no release is queued for this frame.

Drops a drag whose release never reached it (its element went away, the window lost the mouse).

◆ UpdatePreHover()

void tachyon::InputManager::UpdatePreHover ( GUIStateManager & guiStateManager)

Updates the drag position from the latest recorded mouse event; call before hover resolution and GUIStateManager::EndFrame.

◆ SynthesizeMissingMouseEvents()

void tachyon::InputManager::SynthesizeMissingMouseEvents ( int2 screenPos,
MouseButtons lastPhysicalButtons,
MouseButtons physicalButtons )

Detects mouse button presses the OS swallowed (e.g.

clicking behind a parented popup window on Windows) and injects synthetic MouseDown/MouseUp events for them. Call after the window manager's Update, before Process.

◆ Process()

void tachyon::InputManager::Process ( GUIStateManager & guiStateManager,
ElementStorage & elementStorage,
TabChainManager & tabChainManager,
ITextSystem * textSystem,
ID overID )

Per-frame input processing: tab navigation, text editor focus, dispatch to element handlers, and post-dispatch state updates.

Call after guiStateManager.EndFrame().

◆ Dispatch()

void tachyon::InputManager::Dispatch ( GUIStateManager & guiStateManager,
ElementStorage & storage )

Dispatches each recorded event to elements by capture / focus / hover rules, then clears the events.

Process calls it.


The documentation for this class was generated from the following file: