|
RMGui 0.15.0
C11 retained-mode UI library: layout kernel, style schema, widget painters, fonts, software framebuffer
|
input.h — the one input event and result every element input function shares. More...
Data Structures | |
| struct | rmgui_input_t |
| One event in logical framebuffer pixels. More... | |
| struct | rmgui_input_result_t |
| An element input function's report: what happened, and how the host routes the next events. More... | |
Macros | |
| #define | RMGUI_INPUT_MOD_SHIFT 1u |
| KEY modifier bits (rmgui_input_t.u.key.mods). | |
| #define | RMGUI_INPUT_MOD_CTRL 2u |
| #define | RMGUI_INPUT_MOD_ALT 4u |
| #define | RMGUI_INPUT_MOD_META 8u |
Functions | |
| static void | rmgui_input_shape (const rmgui_mask_t *shape, rmgui_rect_t rect, const rmgui_input_t *in, rmgui_input_t *out) |
| Copy *in to *out, filtering MOVE, PRESS, RELEASE and WHEEL positions through shape stretched over rect. | |
input.h — the one input event and result every element input function shares.
Key routing: the host delivers KEY and TEXT events only to the element it considers focused (an open popup counts as focused while it is open); every element acts on every KEY and TEXT event it is given. FOCUS_IN and FOCUS_OUT only tell an element that the host's focus moved (its FOCUSED bit), they never gate keys. Pointer events go to the element under the pointer, and to the element holding the capture while it holds it.
| #define RMGUI_INPUT_MOD_SHIFT 1u |
KEY modifier bits (rmgui_input_t.u.key.mods).
| #define RMGUI_INPUT_MOD_CTRL 2u |
| #define RMGUI_INPUT_MOD_ALT 4u |
| #define RMGUI_INPUT_MOD_META 8u |
| enum rmgui_input_kind_t |
What an input event reports.
| enum rmgui_input_key_t |
A key the elements act on; hosts map their platform keys onto these.
| enum rmgui_cursor_t |
Host cursor request.
NONE leaves the host's current arbitration unchanged; ARROW explicitly restores the default. Results are requests, not OS calls.
| Enumerator | |
|---|---|
| RMGUI_CURSOR_NONE | |
| RMGUI_CURSOR_ARROW | |
| RMGUI_CURSOR_TEXT | |
| RMGUI_CURSOR_POINTER | |
| RMGUI_CURSOR_RESIZE_EW | |
| RMGUI_CURSOR_RESIZE_NS | |
| RMGUI_CURSOR_RESIZE_NWSE | |
| RMGUI_CURSOR_RESIZE_NESW | |
What an element reports for one event.
|
inlinestatic |
Copy *in to *out, filtering MOVE, PRESS, RELEASE and WHEEL positions through shape stretched over rect.
A position inside rect but below the mask hit threshold is moved outside by changing x to rect.x - 1, or rect.x + rect.w when rect.x == INT_MIN. Both are representable: the latter is used only for a positive width. y and every other field remain unchanged; LEAVE, KEY, TEXT and FOCUS events are copied unchanged. NULL shape copies unchanged. NULL in/out is a no-op; in == out is allowed. For grouped element input, rect must enclose all of its input regions. Filtering does not cancel capture: the element handles the outside event according to its normal drag/release contract.