File Input.h
Go to the source code of this file
Input handling system for keyboard, mouse, and viewport state.More...
#include "ID.h"#include "Context.h"#include "operator.h"#include <unordered_map>#include <functional>#include <typeindex>#include <string>
Classes
| Type | Name |
|---|---|
| class | Input Input handling system for keyboard, mouse, and viewport state. |
| struct | InputState Combined input state snapshot. |
| struct | KeyState Keyboard state snapshot. |
| struct | MouseState Mouse state snapshot. |
| struct | RandomState Global random value state for random algorithms. |
Macros
| Type | Name |
|---|---|
| define | NORM_KEY_LEN 36 |
| define | REGIST_EVENT (cls_event) std::bind(&cls\_event, this, std::placeholders::\_1); Input::REFLRigisterEvent(#cls\_event) |
| define | REGIST_EVENT_STATIC (sta_event) &sta\_event; Input::REFLRigisterEvent(#sta\_event) |
| define | SPE_KEY_LEN 3 |
Detailed Description
Input provides a unified interface for querying user input state. It captures keyboard keys, mouse buttons, mouse position/delta, scroll, and special keys (Shift, Ctrl, Alt) into a consistent state snapshot updated each frame. Four global random values are also considered as apart of the input state for use in random algorithms.
Architecture: * Input state is captured via UpdateState() from GLFW each frame * Current and previous frame states allow delta/change detection * Static query methods provide convenient state checks * Hotkey system supports special key combinations
Usage Pattern: * UpdateState() at frame start - Snapshot current input * Controllers/UI query state via static methods * React to input changes (clicked, pressed, released)
Note:
Editor Layer: Input is part of the Editor system, not UI or Renderer
Note:
Thread-safety: Not thread-safe. Must be used from main thread only.
Macro Definition Documentation
define NORM_KEY_LEN
#define NORM_KEY_LEN `36`
define REGIST_EVENT
#define REGIST_EVENT (
cls_event
) `std::bind(&cls_event, this, std::placeholders::_1); Input::REFLRigisterEvent(#cls_event)`
define REGIST_EVENT_STATIC
#define REGIST_EVENT_STATIC (
sta_event
) `&sta_event; Input::REFLRigisterEvent(#sta_event)`
define SPE_KEY_LEN
#define SPE_KEY_LEN `3`
The documentation for this class was generated from the following file src/editor/Input.h