mk_drag_event_initfunction
void mk_drag_event_init(mk_drag_event_t *event)Initialize the drag event.
| Parameter | Type | Description |
|---|---|---|
event | mk_drag_event_t * | Value for event. |
#include <modkit/event.h>19 functions · 9 structs · 11 enums · 23 typedefs · 5 macros
SDL-independent platform events and Unicode text boundaries.
mk_drag_event_initfunctionvoid mk_drag_event_init(mk_drag_event_t *event)Initialize the drag event.
| Parameter | Type | Description |
|---|---|---|
event | mk_drag_event_t * | Value for event. |
mk_event_initfunctionvoid mk_event_init(mk_event_t *event, mk_event_type_t type)Initialize the event.
| Parameter | Type | Description |
|---|---|---|
event | mk_event_t * | Value for event. |
type | mk_event_type_t | Value for type. |
mk_event_listener_desc_initfunctionvoid mk_event_listener_desc_init(mk_event_listener_desc_t *desc)Initialize the event listener desc.
| Parameter | Type | Description |
|---|---|---|
desc | mk_event_listener_desc_t * | Configuration descriptor. |
mk_event_postfunctionmk_result mk_event_post(const mk_event_t *event)Queue a deep copy for dispatch from a later main-loop poll.
| Parameter | Type | Description |
|---|---|---|
event | const mk_event_t * | Value for event. |
Returns MK_SUCCESS or an error result.
mk_event_subscribefunctionmk_result mk_event_subscribe(const mk_event_listener_desc_t *desc, mk_event_listener_t *listener)Perform the event subscribe operation.
| Parameter | Type | Description |
|---|---|---|
desc | const mk_event_listener_desc_t * | Configuration descriptor. |
listener | mk_event_listener_t * | Value for listener. |
Returns MK_SUCCESS or an error result.
mk_event_unsubscribefunctionbool mk_event_unsubscribe(mk_event_listener_t listener)Perform the event unsubscribe operation.
| Parameter | Type | Description |
|---|---|---|
listener | mk_event_listener_t | Value for listener. |
Returns True when the operation succeeds.
mk_ime_candidates_event_initfunctionvoid mk_ime_candidates_event_init(mk_ime_candidates_event_t *event)Initialize the IME candidates event.
| Parameter | Type | Description |
|---|---|---|
event | mk_ime_candidates_event_t * | Value for event. |
mk_key_event_initfunctionvoid mk_key_event_init(mk_key_event_t *event)Initialize the key event.
| Parameter | Type | Description |
|---|---|---|
event | mk_key_event_t * | Value for event. |
mk_platform_window_event_initfunctionvoid mk_platform_window_event_init(mk_platform_window_event_t *event)Initialize the platform window event.
| Parameter | Type | Description |
|---|---|---|
event | mk_platform_window_event_t * | Value for event. |
mk_pointer_capturefunctionmk_result mk_pointer_capture(mk_event_listener_t listener, uint64_t pointer_id)Capture subsequent events for pointer_id to one listener.
| Parameter | Type | Description |
|---|---|---|
listener | mk_event_listener_t | Value for listener. |
pointer_id | uint64_t | Value for pointer ID. |
Returns MK_SUCCESS or an error result.
mk_pointer_event_initfunctionvoid mk_pointer_event_init(mk_pointer_event_t *event)Initialize the pointer event.
| Parameter | Type | Description |
|---|---|---|
event | mk_pointer_event_t * | Value for event. |
mk_pointer_releasefunctionbool mk_pointer_release(mk_event_listener_t listener, uint64_t pointer_id)Release pointer.
| Parameter | Type | Description |
|---|---|---|
listener | mk_event_listener_t | Value for listener. |
pointer_id | uint64_t | Value for pointer ID. |
Returns True when the operation succeeds.
mk_scroll_event_initfunctionvoid mk_scroll_event_init(mk_scroll_event_t *event)Initialize the scroll event.
| Parameter | Type | Description |
|---|---|---|
event | mk_scroll_event_t * | Value for event. |
mk_text_event_initfunctionvoid mk_text_event_init(mk_text_event_t *event)Initialize the text event.
| Parameter | Type | Description |
|---|---|---|
event | mk_text_event_t * | Value for event. |
mk_text_input_capabilitiesfunctionuint32_t mk_text_input_capabilities(void)Perform the text input capabilities operation.
Returns The resulting value.
mk_utf8_boundary_clampfunctionsize_t mk_utf8_boundary_clamp(const char *text, size_t text_length, size_t offset, mk_utf8_boundary_kind_t kind, mk_utf8_clamp_direction_t direction)Perform the UTF-8 boundary clamp operation.
| Parameter | Type | Description |
|---|---|---|
text | const char * | Value for text. |
text_length | size_t | Value for text length. |
offset | size_t | Value for offset. |
kind | mk_utf8_boundary_kind_t | Value for kind. |
direction | mk_utf8_clamp_direction_t | Value for direction. |
Returns The resulting value.
mk_utf8_boundary_isfunctionbool mk_utf8_boundary_is(const char *text, size_t text_length, size_t offset, mk_utf8_boundary_kind_t kind)Test whether the UTF-8 boundary is active.
| Parameter | Type | Description |
|---|---|---|
text | const char * | Value for text. |
text_length | size_t | Value for text length. |
offset | size_t | Value for offset. |
kind | mk_utf8_boundary_kind_t | Value for kind. |
Returns True when the operation succeeds.
mk_utf8_boundary_nextfunctionsize_t mk_utf8_boundary_next(const char *text, size_t text_length, size_t offset, mk_utf8_boundary_kind_t kind)Boundary offsets are UTF-8 byte offsets in [0, text_length].
| Parameter | Type | Description |
|---|---|---|
text | const char * | Value for text. |
text_length | size_t | Value for text length. |
offset | size_t | Value for offset. |
kind | mk_utf8_boundary_kind_t | Value for kind. |
Returns The resulting value.
mk_utf8_boundary_previousfunctionsize_t mk_utf8_boundary_previous(const char *text, size_t text_length, size_t offset, mk_utf8_boundary_kind_t kind)Perform the UTF-8 boundary previous operation.
| Parameter | Type | Description |
|---|---|---|
text | const char * | Value for text. |
text_length | size_t | Value for text length. |
offset | size_t | Value for offset. |
kind | mk_utf8_boundary_kind_t | Value for kind. |
Returns The resulting value.
mk_drag_eventstructData for drag event.
| Field | Type | Description |
|---|---|---|
struct_size | uint32_t | The struct size. |
struct_version | uint32_t | The struct version. |
phase | mk_drag_phase_t | The phase. |
x | float | The x. |
y | float | The y. |
source_application | const char * | The source application. |
item | const mk_transfer_item_t * | The item. |
mk_eventstructData for event.
| Field | Type | Description |
|---|---|---|
struct_size | uint32_t | The struct size. |
struct_version | uint32_t | The struct version. |
type | mk_event_type_t | The type. |
timestamp_ns | uint64_t | The timestamp ns. |
window_id | uint32_t | The window ID. |
data | union mk_event::@326371272376240152046123232227203337044234027132 | The data. |
data.key | mk_key_event_t | The key. |
data.text | mk_text_event_t | The text. |
data.ime_candidates | mk_ime_candidates_event_t | The IME candidates. |
data.pointer | mk_pointer_event_t | The pointer. |
data.scroll | mk_scroll_event_t | The scroll. |
data.window | mk_platform_window_event_t | The window. |
data.system_preferences | mk_system_preferences_t | The system preferences. |
data.drag | mk_drag_event_t | The drag. |
mk_event_listener_descstructData for event listener desc.
| Field | Type | Description |
|---|---|---|
struct_size | uint32_t | The struct size. |
struct_version | uint32_t | The struct version. |
mask | mk_event_mask_t | The mask. |
priority | int32_t | The priority. |
callback | mk_event_listener_fn | The callback. |
user_data | void * | The user data. |
mk_ime_candidates_eventstructData for IME candidates event.
| Field | Type | Description |
|---|---|---|
struct_size | uint32_t | The struct size. |
struct_version | uint32_t | The struct version. |
candidates | const char *const * | The candidates. |
candidate_count | uint32_t | The candidate count. |
selected_candidate | int32_t | The selected candidate. |
horizontal | bool | The horizontal. |
mk_key_eventstructData for key event.
| Field | Type | Description |
|---|---|---|
struct_size | uint32_t | The struct size. |
struct_version | uint32_t | The struct version. |
physical_key | uint32_t | The physical key. |
logical_symbol | uint32_t | The logical symbol. |
modifiers | uint32_t | The modifiers. |
pressed | bool | The pressed. |
repeat | bool | The repeat. |
mk_platform_window_eventstructData for platform window event.
| Field | Type | Description |
|---|---|---|
struct_size | uint32_t | The struct size. |
struct_version | uint32_t | The struct version. |
type | mk_platform_window_event_type_t | The type. |
width | int32_t | The width. |
height | int32_t | The height. |
scale | float | The scale. |
display_id | uint32_t | The display ID. |
mk_pointer_eventstructData for pointer event.
| Field | Type | Description |
|---|---|---|
struct_size | uint32_t | The struct size. |
struct_version | uint32_t | The struct version. |
pointer_id | uint64_t | The pointer ID. |
kind | mk_pointer_kind_t | The kind. |
phase | mk_pointer_phase_t | The phase. |
x | float | The x. |
y | float | The y. |
delta_x | float | The delta x. |
delta_y | float | The delta y. |
pressure | float | The pressure. |
tilt_x | float | The tilt x. |
tilt_y | float | The tilt y. |
buttons | uint32_t | The buttons. |
button | uint8_t | The button. |
clicks | uint8_t | The clicks. |
mk_scroll_eventstructData for scroll event.
| Field | Type | Description |
|---|---|---|
struct_size | uint32_t | The struct size. |
struct_version | uint32_t | The struct version. |
x | float | The x. |
y | float | The y. |
pointer_x | float | The pointer x. |
pointer_y | float | The pointer y. |
unit | mk_scroll_unit_t | The unit. |
phase | mk_gesture_phase_t | The phase. |
precise | bool | The precise. |
mk_text_eventstructData for text event.
| Field | Type | Description |
|---|---|---|
struct_size | uint32_t | The struct size. |
struct_version | uint32_t | The struct version. |
text | const char * | The text. |
text_length | uint32_t | The text length. |
selection_start | int32_t | The selection start. |
selection_length | int32_t | The selection length. |
mk_drag_phaseenumValues for drag phase.
| Value | Description |
|---|---|
MK_DRAG_BEGIN | Selects begin. |
MK_DRAG_UPDATE | Selects update. |
MK_DRAG_LEAVE | Selects leave. |
MK_DRAG_ITEM | Selects item. |
MK_DRAG_COMPLETE | Selects complete. |
mk_event_typeenumValues for event type.
| Value | Description |
|---|---|
MK_EVENT_NONE | Selects none. |
MK_EVENT_KEY | Selects key. |
MK_EVENT_TEXT_COMMIT | Selects text commit. |
MK_EVENT_IME_COMPOSITION | Selects IME composition. |
MK_EVENT_IME_CANDIDATES | Selects IME candidates. |
MK_EVENT_POINTER | Selects pointer. |
MK_EVENT_SCROLL | Selects scroll. |
MK_EVENT_WINDOW | Selects window. |
MK_EVENT_SYSTEM_PREFERENCES | Selects system preferences. |
MK_EVENT_DRAG | Selects drag. |
mk_gesture_phaseenumValues for gesture phase.
| Value | Description |
|---|---|
MK_GESTURE_NONE | Selects none. |
MK_GESTURE_BEGIN | Selects begin. |
MK_GESTURE_UPDATE | Selects update. |
MK_GESTURE_END | Selects end. |
MK_GESTURE_CANCEL | Selects cancel. |
mk_key_modifierenumValues for key modifier.
| Value | Description |
|---|---|
MK_KEY_MOD_SHIFT | Selects shift. |
MK_KEY_MOD_CONTROL | Selects control. |
MK_KEY_MOD_ALT | Selects alt. |
MK_KEY_MOD_GUI | Selects gui. |
MK_KEY_MOD_CAPS_LOCK | Selects caps lock. |
MK_KEY_MOD_NUM_LOCK | Selects num lock. |
MK_KEY_MOD_SCROLL_LOCK | Selects scroll lock. |
MK_KEY_MOD_ALT_GR | Selects alt gr. |
mk_platform_window_event_typeenumValues for platform window event type.
| Value | Description |
|---|---|
MK_PLATFORM_WINDOW_EVENT_FOCUS_GAINED | Selects focus gained. |
MK_PLATFORM_WINDOW_EVENT_FOCUS_LOST | Selects focus lost. |
MK_PLATFORM_WINDOW_EVENT_RESIZED | Selects resized. |
MK_PLATFORM_WINDOW_EVENT_PIXEL_SIZE_CHANGED | Selects pixel size changed. |
MK_PLATFORM_WINDOW_EVENT_SCALE_CHANGED | Selects scale changed. |
MK_PLATFORM_WINDOW_EVENT_DISPLAY_CHANGED | Selects display changed. |
MK_PLATFORM_WINDOW_EVENT_CLOSE_REQUESTED | Selects close requested. |
MK_PLATFORM_WINDOW_EVENT_DESTROYED | Selects destroyed. |
mk_pointer_kindenumValues for pointer kind.
| Value | Description |
|---|---|
MK_POINTER_MOUSE | Selects mouse. |
MK_POINTER_TOUCH | Selects touch. |
MK_POINTER_PEN | Selects pen. |
MK_POINTER_ERASER | Selects eraser. |
mk_pointer_phaseenumValues for pointer phase.
| Value | Description |
|---|---|
MK_POINTER_HOVER | Selects hover. |
MK_POINTER_DOWN | Selects down. |
MK_POINTER_MOVE | Selects move. |
MK_POINTER_UP | Selects up. |
MK_POINTER_CANCEL | Selects cancel. |
MK_POINTER_ENTER | Selects enter. |
MK_POINTER_LEAVE | Selects leave. |
mk_scroll_unitenumValues for scroll unit.
| Value | Description |
|---|---|
MK_SCROLL_LINES | Selects lines. |
MK_SCROLL_PIXELS | Selects pixels. |
mk_text_input_capabilityenumValues for text input capability.
| Value | Description |
|---|---|
MK_TEXT_INPUT_CAP_COMMIT | Selects commit. |
MK_TEXT_INPUT_CAP_COMPOSITION | Selects composition. |
MK_TEXT_INPUT_CAP_CANDIDATES | Selects candidates. |
MK_TEXT_INPUT_CAP_SCREEN_KEYBOARD | Selects screen keyboard. |
mk_utf8_boundary_kindenumValues for UTF-8 boundary kind.
| Value | Description |
|---|---|
MK_UTF8_BOUNDARY_GRAPHEME | Selects grapheme. |
MK_UTF8_BOUNDARY_WORD | Selects word. |
mk_utf8_clamp_directionenumValues for UTF-8 clamp direction.
| Value | Description |
|---|---|
MK_UTF8_CLAMP_NEAREST | Selects nearest. |
MK_UTF8_CLAMP_BACKWARD | Selects backward. |
MK_UTF8_CLAMP_FORWARD | Selects forward. |
mk_drag_event_ttypedeftypedef struct mk_drag_event mk_drag_event_tData for drag event.
mk_drag_phase_ttypedeftypedef enum mk_drag_phase mk_drag_phase_tValues for drag phase.
mk_event_listener_desc_ttypedeftypedef struct mk_event_listener_desc mk_event_listener_desc_tData for event listener desc.
mk_event_listener_fntypedeftypedef bool(*) mk_event_listener_fn(const mk_event_t *event, void *user_data)Callback used for event listener.
mk_event_listener_ttypedeftypedef uint64_t mk_event_listener_tType used for event listener.
mk_event_mask_ttypedeftypedef uint64_t mk_event_mask_tType used for event mask.
mk_event_ttypedeftypedef struct mk_event mk_event_tData for event.
mk_event_type_ttypedeftypedef enum mk_event_type mk_event_type_tValues for event type.
mk_gesture_phase_ttypedeftypedef enum mk_gesture_phase mk_gesture_phase_tValues for gesture phase.
mk_ime_candidates_event_ttypedeftypedef struct mk_ime_candidates_event mk_ime_candidates_event_tData for IME candidates event.
mk_key_event_ttypedeftypedef struct mk_key_event mk_key_event_tData for key event.
mk_key_modifier_ttypedeftypedef enum mk_key_modifier mk_key_modifier_tValues for key modifier.
mk_platform_window_event_ttypedeftypedef struct mk_platform_window_event mk_platform_window_event_tData for platform window event.
mk_platform_window_event_type_ttypedeftypedef enum mk_platform_window_event_type mk_platform_window_event_type_tValues for platform window event type.
mk_pointer_event_ttypedeftypedef struct mk_pointer_event mk_pointer_event_tData for pointer event.
mk_pointer_kind_ttypedeftypedef enum mk_pointer_kind mk_pointer_kind_tValues for pointer kind.
mk_pointer_phase_ttypedeftypedef enum mk_pointer_phase mk_pointer_phase_tValues for pointer phase.
mk_scroll_event_ttypedeftypedef struct mk_scroll_event mk_scroll_event_tData for scroll event.
mk_scroll_unit_ttypedeftypedef enum mk_scroll_unit mk_scroll_unit_tValues for scroll unit.
mk_text_event_ttypedeftypedef struct mk_text_event mk_text_event_tData for text event.
mk_text_input_capability_ttypedeftypedef enum mk_text_input_capability mk_text_input_capability_tValues for text input capability.
mk_utf8_boundary_kind_ttypedeftypedef enum mk_utf8_boundary_kind mk_utf8_boundary_kind_tValues for UTF-8 boundary kind.
mk_utf8_clamp_direction_ttypedeftypedef enum mk_utf8_clamp_direction mk_utf8_clamp_direction_tValues for UTF-8 clamp direction.
MK_EVENT_LISTENER_DESC_VERSIONdefineMK_EVENT_LISTENER_DESC_VERSIONABI or format version for event listener desc.
MK_EVENT_LISTENER_INVALIDdefineMK_EVENT_LISTENER_INVALIDInvalid sentinel for event listener.
MK_EVENT_MASKdefineMK_EVENT_MASK(type)Constant for event mask.
MK_EVENT_MASK_ALLdefineMK_EVENT_MASK_ALLConstant for event mask all.
MK_EVENT_VERSIONdefineMK_EVENT_VERSIONABI or format version for event.