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

Sends every platform input event to all handlers (e.g. More...

#include <gui_core/input/gui_input_handler_broadcaster.h>

Inheritance diagram for tachyon::InputHandlerBroadcaster:

Public Member Functions

 InputHandlerBroadcaster ()=default
 InputHandlerBroadcaster (std::initializer_list< IPlatformInputHandler * > handlers)
void OnKeyboard (tachyon::ID id, KeyCode key, int repeat, KeyModifier modifiers, KeyAction action) override
 A key went down or up (key is its KeyCode, repeat nonzero for an auto-repeat), or a character was typed (KeyAction::KeyChar: key holds its Unicode codepoint).
void OnMouseMove (tachyon::ID id, tachyon::int2 screenPos, tachyon::MouseButtons buttons, KeyModifier modifiers) override
 The mouse moved over window id; screenPos in screen pixels, buttons those held down.
void OnMouseButton (tachyon::ID id, tachyon::int2 screenPos, tachyon::MouseButtons buttons, KeyModifier modifiers, tachyon::MouseAction action) override
 A mouse button went down or up; buttons are those held down after the change.
void OnMouseScroll (tachyon::ID id, tachyon::int2 screenPos, tachyon::float2 scrollOffset, KeyModifier modifiers) override
 The wheel turned, by scrollOffset notches; positive y is away from the user (scrolls up).
void OnTextComposition (tachyon::ID id, std::string_view text, int32_t cursor) override
 IME composition (pre-edit) text, UTF-8, shown but not yet committed; empty when composing ends.
void OnFileDrop (tachyon::ID id, tachyon::int2 screenPos, FileDropAction action, std::string_view data) override
 A drag from another application over window id: it came, moved to screenPos (screen pixels), dropped a file or text (data), or ended (dropped, or left the window).
Public Member Functions inherited from tachyon::IPlatformInputHandler
virtual ~IPlatformInputHandler ()=default

Detailed Description

Sends every platform input event to all handlers (e.g.

InputManager + ITextSystem); none can block the others.

Constructor & Destructor Documentation

◆ InputHandlerBroadcaster() [1/2]

tachyon::InputHandlerBroadcaster::InputHandlerBroadcaster ( )
default

◆ InputHandlerBroadcaster() [2/2]

tachyon::InputHandlerBroadcaster::InputHandlerBroadcaster ( std::initializer_list< IPlatformInputHandler * > handlers)
inlineexplicit

Member Function Documentation

◆ OnKeyboard()

void tachyon::InputHandlerBroadcaster::OnKeyboard ( tachyon::ID id,
KeyCode key,
int repeat,
KeyModifier modifiers,
KeyAction action )
inlineoverridevirtual

A key went down or up (key is its KeyCode, repeat nonzero for an auto-repeat), or a character was typed (KeyAction::KeyChar: key holds its Unicode codepoint).

Implements tachyon::IPlatformInputHandler.

◆ OnMouseMove()

void tachyon::InputHandlerBroadcaster::OnMouseMove ( tachyon::ID id,
tachyon::int2 screenPos,
tachyon::MouseButtons buttons,
KeyModifier modifiers )
inlineoverridevirtual

The mouse moved over window id; screenPos in screen pixels, buttons those held down.

Implements tachyon::IPlatformInputHandler.

◆ OnMouseButton()

void tachyon::InputHandlerBroadcaster::OnMouseButton ( tachyon::ID id,
tachyon::int2 screenPos,
tachyon::MouseButtons buttons,
KeyModifier modifiers,
tachyon::MouseAction action )
inlineoverridevirtual

A mouse button went down or up; buttons are those held down after the change.

Implements tachyon::IPlatformInputHandler.

◆ OnMouseScroll()

void tachyon::InputHandlerBroadcaster::OnMouseScroll ( tachyon::ID id,
tachyon::int2 screenPos,
tachyon::float2 scrollOffset,
KeyModifier modifiers )
inlineoverridevirtual

The wheel turned, by scrollOffset notches; positive y is away from the user (scrolls up).

Implements tachyon::IPlatformInputHandler.

◆ OnTextComposition()

void tachyon::InputHandlerBroadcaster::OnTextComposition ( tachyon::ID id,
std::string_view text,
int32_t cursor )
inlineoverridevirtual

IME composition (pre-edit) text, UTF-8, shown but not yet committed; empty when composing ends.

cursor is the caret's codepoint offset within it. Committed text still arrives as KeyChar.

Implements tachyon::IPlatformInputHandler.

◆ OnFileDrop()

void tachyon::InputHandlerBroadcaster::OnFileDrop ( tachyon::ID id,
tachyon::int2 screenPos,
FileDropAction action,
std::string_view data )
inlineoverridevirtual

A drag from another application over window id: it came, moved to screenPos (screen pixels), dropped a file or text (data), or ended (dropped, or left the window).

Reimplemented from tachyon::IPlatformInputHandler.


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