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

Platform-level input interface: receives raw OS events (keyboard, mouse) and forwards them into the GUI input pipeline. More...

#include <gui_core/input/gui_platform_input_handler.h>

Inheritance diagram for tachyon::IPlatformInputHandler:

Public Member Functions

virtual ~IPlatformInputHandler ()=default
virtual void OnKeyboard (tachyon::ID id, KeyCode key, int repeat, KeyModifier modifiers, KeyAction action)=0
 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).
virtual void OnMouseMove (tachyon::ID id, tachyon::int2 screenPos, tachyon::MouseButtons buttons, KeyModifier modifiers)=0
 The mouse moved over window id; screenPos in screen pixels, buttons those held down.
virtual void OnMouseButton (tachyon::ID id, tachyon::int2 screenPos, tachyon::MouseButtons buttons, KeyModifier modifiers, tachyon::MouseAction action)=0
 A mouse button went down or up; buttons are those held down after the change.
virtual void OnMouseScroll (tachyon::ID id, tachyon::int2 screenPos, tachyon::float2 scrollOffset, KeyModifier modifiers)=0
 The wheel turned, by scrollOffset notches; positive y is away from the user (scrolls up).
virtual void OnTextComposition (tachyon::ID id, std::string_view text, int32_t cursor)=0
 IME composition (pre-edit) text, UTF-8, shown but not yet committed; empty when composing ends.
virtual void OnFileDrop (tachyon::ID, tachyon::int2, FileDropAction, std::string_view)
 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).

Detailed Description

Platform-level input interface: receives raw OS events (keyboard, mouse) and forwards them into the GUI input pipeline.

Constructor & Destructor Documentation

◆ ~IPlatformInputHandler()

virtual tachyon::IPlatformInputHandler::~IPlatformInputHandler ( )
virtualdefault

Member Function Documentation

◆ OnKeyboard()

virtual void tachyon::IPlatformInputHandler::OnKeyboard ( tachyon::ID id,
KeyCode key,
int repeat,
KeyModifier modifiers,
KeyAction action )
pure virtual

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).

Implemented in tachyon::InputHandlerBroadcaster, tachyon::InputManager, tachyon::ITextSystem, and tachyon::SkribidiTextSystem.

◆ OnMouseMove()

virtual void tachyon::IPlatformInputHandler::OnMouseMove ( tachyon::ID id,
tachyon::int2 screenPos,
tachyon::MouseButtons buttons,
KeyModifier modifiers )
pure virtual

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

Implemented in tachyon::InputHandlerBroadcaster, tachyon::InputManager, tachyon::ITextSystem, and tachyon::SkribidiTextSystem.

◆ OnMouseButton()

virtual void tachyon::IPlatformInputHandler::OnMouseButton ( tachyon::ID id,
tachyon::int2 screenPos,
tachyon::MouseButtons buttons,
KeyModifier modifiers,
tachyon::MouseAction action )
pure virtual

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

Implemented in tachyon::InputHandlerBroadcaster, tachyon::InputManager, tachyon::ITextSystem, and tachyon::SkribidiTextSystem.

◆ OnMouseScroll()

virtual void tachyon::IPlatformInputHandler::OnMouseScroll ( tachyon::ID id,
tachyon::int2 screenPos,
tachyon::float2 scrollOffset,
KeyModifier modifiers )
pure virtual

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

Implemented in tachyon::InputHandlerBroadcaster, tachyon::InputManager, tachyon::ITextSystem, and tachyon::SkribidiTextSystem.

◆ OnTextComposition()

virtual void tachyon::IPlatformInputHandler::OnTextComposition ( tachyon::ID id,
std::string_view text,
int32_t cursor )
pure virtual

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.

Implemented in tachyon::InputHandlerBroadcaster, tachyon::InputManager, and tachyon::SkribidiTextSystem.

◆ OnFileDrop()

virtual void tachyon::IPlatformInputHandler::OnFileDrop ( tachyon::ID ,
tachyon::int2 ,
FileDropAction ,
std::string_view  )
inlinevirtual

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 in tachyon::InputHandlerBroadcaster, and tachyon::InputManager.


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