mk_action_atfunction
mk_action mk_action_at(uint32_t index)Get action handle by zero-based index, or MK_ACTION_INVALID if out of range.
| Parameter | Type | Description |
|---|---|---|
index | uint32_t | Zero-based index. |
Returns The resulting value.
#include <modkit/input.h>138 functions · 7 structs · 11 enums · 21 typedefs · 10 macros
Input abstraction for keyboard, mouse, touch, and gamepad.
Provides three layers of input handling:Raw state polling (keyboard, mouse, touch, gamepad)State tracking (pressed, released, held)Action mapping (configurable named actions) Example:
mk_action_atfunctionmk_action mk_action_at(uint32_t index)Get action handle by zero-based index, or MK_ACTION_INVALID if out of range.
| Parameter | Type | Description |
|---|---|---|
index | uint32_t | Zero-based index. |
Returns The resulting value.
mk_action_axis1functionfloat mk_action_axis1(mk_action negative, mk_action positive)Axis helpers.
axis1 returns positive minus negative. axis2 returns x = positive_x - negative_x, y = positive_y - negative_y.
| Parameter | Type | Description |
|---|---|---|
negative | mk_action | Value for negative. |
positive | mk_action | Value for positive. |
Returns The resulting value.
mk_action_axis2functionvoid mk_action_axis2(mk_action negative_x, mk_action positive_x, mk_action negative_y, mk_action positive_y, float *x, float *y)Perform the action axis2 operation.
| Parameter | Type | Description |
|---|---|---|
negative_x | mk_action | Value for negative x. |
positive_x | mk_action | Value for positive x. |
negative_y | mk_action | Value for negative y. |
positive_y | mk_action | Value for positive y. |
x | float * | Value for x. |
y | float * | Value for y. |
mk_action_bind_gamepad_axisfunctionvoid mk_action_bind_gamepad_axis(mk_action action, mk_gamepad_axis gaxis, float threshold)Bind a gamepad axis to an action.
The action becomes active when the axis exceeds the threshold. Use negative threshold for negative axis direction (e.g., -0.5 for left on stick).
| Parameter | Type | Description |
|---|---|---|
action | mk_action | Value for action. |
gaxis | mk_gamepad_axis | Value for gaxis. |
threshold | float | Value for threshold. |
mk_action_bind_gamepad_axis_forfunctionvoid mk_action_bind_gamepad_axis_for(mk_action action, int gamepad, mk_gamepad_axis gaxis, float threshold)Bind gamepad axis for for the action.
| Parameter | Type | Description |
|---|---|---|
action | mk_action | Value for action. |
gamepad | int | Value for gamepad. |
gaxis | mk_gamepad_axis | Value for gaxis. |
threshold | float | Value for threshold. |
mk_action_bind_gamepad_axis_valuefunctionvoid mk_action_bind_gamepad_axis_value(mk_action action, mk_gamepad_axis gaxis, float deadzone, float scale)Bind gamepad axis value for the action.
| Parameter | Type | Description |
|---|---|---|
action | mk_action | Value for action. |
gaxis | mk_gamepad_axis | Value for gaxis. |
deadzone | float | Value for deadzone. |
scale | float | Value for scale. |
mk_action_bind_gamepad_axis_value_forfunctionvoid mk_action_bind_gamepad_axis_value_for(mk_action action, int gamepad, mk_gamepad_axis gaxis, float deadzone, float scale)Bind gamepad axis value for for the action.
| Parameter | Type | Description |
|---|---|---|
action | mk_action | Value for action. |
gamepad | int | Value for gamepad. |
gaxis | mk_gamepad_axis | Value for gaxis. |
deadzone | float | Value for deadzone. |
scale | float | Value for scale. |
mk_action_bind_gamepad_buttonfunctionvoid mk_action_bind_gamepad_button(mk_action action, mk_gamepad_button button)Bind a gamepad button to an action.
Binds for all gamepads (any connected gamepad can trigger the action).
| Parameter | Type | Description |
|---|---|---|
action | mk_action | Value for action. |
button | mk_gamepad_button | Value for button. |
mk_action_bind_gamepad_button_forfunctionvoid mk_action_bind_gamepad_button_for(mk_action action, int gamepad, mk_gamepad_button button)Gamepad-specific convenience bindings on the default action map.
| Parameter | Type | Description |
|---|---|---|
action | mk_action | Value for action. |
gamepad | int | Value for gamepad. |
button | mk_gamepad_button | Value for button. |
mk_action_bind_keyfunctionvoid mk_action_bind_key(mk_action action, mk_keycode key)Bind a keyboard key to an action.
Multiple keys can be bound to the same action.
| Parameter | Type | Description |
|---|---|---|
action | mk_action | Value for action. |
key | mk_keycode | Value for key. |
mk_action_bind_mousefunctionvoid mk_action_bind_mouse(mk_action action, mk_mouse_button button)Bind a mouse button to an action.
| Parameter | Type | Description |
|---|---|---|
action | mk_action | Value for action. |
button | mk_mouse_button | Value for button. |
mk_action_bind_touch_regionfunctionvoid mk_action_bind_touch_region(mk_action action, mk_rectf region)Bind a touch region to an action.
Region is in normalized coordinates (0-1), where (0,0) is top-left.
| Parameter | Type | Description |
|---|---|---|
action | mk_action | Value for action. |
region | mk_rectf | Value for region. |
mk_action_countfunctionuint32_t mk_action_count(void)Get number of registered actions.
Returns The resulting value.
mk_action_default_mapfunctionmk_action_map mk_action_default_map(void)Get the built-in default action map used by the legacy mk_action_bind_* APIs.
Returns The resulting value.
mk_action_downfunctionbool mk_action_down(mk_action action)Check if an action is currently active (any bound input is down).
| Parameter | Type | Description |
|---|---|---|
action | mk_action | Value for action. |
Returns True when the operation succeeds.
mk_action_down_for_gamepadfunctionbool mk_action_down_for_gamepad(mk_action action, int gamepad)Query only gamepad bindings for a specific pad/player.
| Parameter | Type | Description |
|---|---|---|
action | mk_action | Value for action. |
gamepad | int | Value for gamepad. |
Returns True when the operation succeeds.
mk_action_findfunctionmk_action mk_action_find(const char *name)Find an action by name.
Returns MK_ACTION_INVALID if not found.
| Parameter | Type | Description |
|---|---|---|
name | const char * | Stable name. |
Returns The resulting value.
mk_action_map_activefunctionbool mk_action_map_active(mk_action_map map)Perform the action map active operation.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
Returns True when the operation succeeds.
mk_action_map_atfunctionmk_action_map mk_action_map_at(uint32_t index)Perform the action map at operation.
| Parameter | Type | Description |
|---|---|---|
index | uint32_t | Zero-based index. |
Returns The resulting value.
mk_action_map_axis1functionfloat mk_action_map_axis1(mk_action_map map, mk_action negative, mk_action positive)Perform the action map axis1 operation.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
negative | mk_action | Value for negative. |
positive | mk_action | Value for positive. |
Returns The resulting value.
mk_action_map_axis2functionvoid mk_action_map_axis2(mk_action_map map, mk_action negative_x, mk_action positive_x, mk_action negative_y, mk_action positive_y, float *x, float *y)Perform the action map axis2 operation.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
negative_x | mk_action | Value for negative x. |
positive_x | mk_action | Value for positive x. |
negative_y | mk_action | Value for negative y. |
positive_y | mk_action | Value for positive y. |
x | float * | Value for x. |
y | float * | Value for y. |
mk_action_map_bindfunctionbool mk_action_map_bind(mk_action_map map, mk_action action, const mk_action_binding *binding)Bind/unbind action-map inputs.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
action | mk_action | Value for action. |
binding | const mk_action_binding * | Value for binding. |
Returns True when the operation succeeds.
mk_action_map_bind_gamepad_axisfunctionbool mk_action_map_bind_gamepad_axis(mk_action_map map, mk_action action, mk_gamepad_axis gaxis, float threshold)Bind gamepad axis for the action map.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
action | mk_action | Value for action. |
gaxis | mk_gamepad_axis | Value for gaxis. |
threshold | float | Value for threshold. |
Returns True when the operation succeeds.
mk_action_map_bind_gamepad_axis_forfunctionbool mk_action_map_bind_gamepad_axis_for(mk_action_map map, mk_action action, int gamepad, mk_gamepad_axis gaxis, float threshold)Bind gamepad axis for for the action map.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
action | mk_action | Value for action. |
gamepad | int | Value for gamepad. |
gaxis | mk_gamepad_axis | Value for gaxis. |
threshold | float | Value for threshold. |
Returns True when the condition holds.
mk_action_map_bind_gamepad_axis_valuefunctionbool mk_action_map_bind_gamepad_axis_value(mk_action_map map, mk_action action, mk_gamepad_axis gaxis, float deadzone, float scale)Bind gamepad axis value for the action map.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
action | mk_action | Value for action. |
gaxis | mk_gamepad_axis | Value for gaxis. |
deadzone | float | Value for deadzone. |
scale | float | Value for scale. |
Returns True when the condition holds.
mk_action_map_bind_gamepad_axis_value_forfunctionbool mk_action_map_bind_gamepad_axis_value_for(mk_action_map map, mk_action action, int gamepad, mk_gamepad_axis gaxis, float deadzone, float scale)Bind gamepad axis value for for the action map.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
action | mk_action | Value for action. |
gamepad | int | Value for gamepad. |
gaxis | mk_gamepad_axis | Value for gaxis. |
deadzone | float | Value for deadzone. |
scale | float | Value for scale. |
Returns True when the condition holds.
mk_action_map_bind_gamepad_buttonfunctionbool mk_action_map_bind_gamepad_button(mk_action_map map, mk_action action, mk_gamepad_button button)Bind gamepad button for the action map.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
action | mk_action | Value for action. |
button | mk_gamepad_button | Value for button. |
Returns True when the operation succeeds.
mk_action_map_bind_gamepad_button_forfunctionbool mk_action_map_bind_gamepad_button_for(mk_action_map map, mk_action action, int gamepad, mk_gamepad_button button)Bind gamepad button for for the action map.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
action | mk_action | Value for action. |
gamepad | int | Value for gamepad. |
button | mk_gamepad_button | Value for button. |
Returns True when the operation succeeds.
mk_action_map_bind_keyfunctionbool mk_action_map_bind_key(mk_action_map map, mk_action action, mk_keycode key)Bind key for the action map.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
action | mk_action | Value for action. |
key | mk_keycode | Value for key. |
Returns True when the operation succeeds.
mk_action_map_bind_mousefunctionbool mk_action_map_bind_mouse(mk_action_map map, mk_action action, mk_mouse_button button)Bind mouse for the action map.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
action | mk_action | Value for action. |
button | mk_mouse_button | Value for button. |
Returns True when the operation succeeds.
mk_action_map_bind_touch_regionfunctionbool mk_action_map_bind_touch_region(mk_action_map map, mk_action action, mk_rectf region)Bind touch region for the action map.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
action | mk_action | Value for action. |
region | mk_rectf | Value for region. |
Returns True when the operation succeeds.
mk_action_map_binding_atfunctionbool mk_action_map_binding_at(mk_action_map map, mk_action action, uint32_t index, mk_action_binding *out_binding)Perform the action map binding at operation.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
action | mk_action | Value for action. |
index | uint32_t | Zero-based index. |
out_binding | mk_action_binding * | Receives the binding. |
Returns True when the operation succeeds.
mk_action_map_binding_countfunctionuint32_t mk_action_map_binding_count(mk_action_map map, mk_action action)Enumerate bindings for rebinding UIs or app-level serialization.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
action | mk_action | Value for action. |
Returns The resulting value.
mk_action_map_consumes_inputfunctionbool mk_action_map_consumes_input(mk_action_map map)Perform the action map consumes input operation.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
Returns True when the operation succeeds.
mk_action_map_countfunctionuint32_t mk_action_map_count(void)Enumerate action maps.
Returns The resulting value.
mk_action_map_createfunctionmk_action_map mk_action_map_create(const char *name)Create/find/destroy named action maps.
Creating a map with an existing name returns the existing handle.
| Parameter | Type | Description |
|---|---|---|
name | const char * | Stable name. |
Returns The resulting value.
mk_action_map_destroyfunctionvoid mk_action_map_destroy(mk_action_map map)Destroy the action map.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
mk_action_map_downfunctionbool mk_action_map_down(mk_action_map map, mk_action action)Explicit map queries ignore stack consumption and priority.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
action | mk_action | Value for action. |
Returns True when the operation succeeds.
mk_action_map_down_for_gamepadfunctionbool mk_action_map_down_for_gamepad(mk_action_map map, mk_action action, int gamepad)Perform the action map down for gamepad operation.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
action | mk_action | Value for action. |
gamepad | int | Value for gamepad. |
Returns True when the operation succeeds.
mk_action_map_findfunctionmk_action_map mk_action_map_find(const char *name)Find action map.
| Parameter | Type | Description |
|---|---|---|
name | const char * | Stable name. |
Returns The resulting value.
mk_action_map_namefunctionconst char * mk_action_map_name(mk_action_map map)Perform the action map name operation.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
Returns A borrowed pointer, or NULL when unavailable.
mk_action_map_pressedfunctionbool mk_action_map_pressed(mk_action_map map, mk_action action)Perform the action map pressed operation.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
action | mk_action | Value for action. |
Returns True when the operation succeeds.
mk_action_map_priorityfunctionint mk_action_map_priority(mk_action_map map)Perform the action map priority operation.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
Returns The resulting value.
mk_action_map_releasedfunctionbool mk_action_map_released(mk_action_map map, mk_action action)Perform the action map released operation.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
action | mk_action | Value for action. |
Returns True when the operation succeeds.
mk_action_map_set_activefunctionvoid mk_action_map_set_active(mk_action_map map, bool active)Configure map participation in stack-aware global action queries.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
active | bool | Value for active. |
mk_action_map_set_consumes_inputfunctionvoid mk_action_map_set_consumes_input(mk_action_map map, bool consumes_input)Set consumes input on the action map.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
consumes_input | bool | Value for consumes input. |
mk_action_map_set_priorityfunctionvoid mk_action_map_set_priority(mk_action_map map, int priority)Set priority on the action map.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
priority | int | Value for priority. |
mk_action_map_unbindfunctionbool mk_action_map_unbind(mk_action_map map, mk_action action, const mk_action_binding *binding)Unbind action map.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
action | mk_action | Value for action. |
binding | const mk_action_binding * | Value for binding. |
Returns True when the operation succeeds.
mk_action_map_unbind_allfunctionvoid mk_action_map_unbind_all(mk_action_map map, mk_action action)Unbind all for the action map.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
action | mk_action | Value for action. |
mk_action_map_valuefunctionfloat mk_action_map_value(mk_action_map map, mk_action action)Perform the action map value operation.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
action | mk_action | Value for action. |
Returns The resulting value.
mk_action_map_value_for_gamepadfunctionfloat mk_action_map_value_for_gamepad(mk_action_map map, mk_action action, int gamepad)Perform the action map value for gamepad operation.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
action | mk_action | Value for action. |
gamepad | int | Value for gamepad. |
Returns The resulting value.
mk_action_map_value2functionvoid mk_action_map_value2(mk_action_map map, mk_action x_action, mk_action y_action, float *x, float *y)Perform the action map value2 operation.
| Parameter | Type | Description |
|---|---|---|
map | mk_action_map | Value for map. |
x_action | mk_action | Value for x action. |
y_action | mk_action | Value for y action. |
x | float * | Value for x. |
y | float * | Value for y. |
mk_action_namefunctionconst char * mk_action_name(mk_action action)Get action name.
Returns NULL if action is invalid.
| Parameter | Type | Description |
|---|---|---|
action | mk_action | Value for action. |
Returns A borrowed pointer, or NULL when unavailable.
mk_action_pressedfunctionbool mk_action_pressed(mk_action action)Check if an action was just activated this frame.
| Parameter | Type | Description |
|---|---|---|
action | mk_action | Value for action. |
Returns True when the operation succeeds.
mk_action_registerfunctionmk_action mk_action_register(const char *name)Register a named action.
Returns the action handle, or MK_ACTION_INVALID if max actions reached. If an action with the same name exists, returns the existing handle.
| Parameter | Type | Description |
|---|---|---|
name | const char * | Stable name. |
Returns The resulting value.
mk_action_releasedfunctionbool mk_action_released(mk_action action)Check if an action was just deactivated this frame.
| Parameter | Type | Description |
|---|---|---|
action | mk_action | Value for action. |
Returns True when the operation succeeds.
mk_action_unbind_allfunctionvoid mk_action_unbind_all(mk_action action)Unbind all inputs from an action.
| Parameter | Type | Description |
|---|---|---|
action | mk_action | Value for action. |
mk_action_unbind_gamepad_buttonfunctionvoid mk_action_unbind_gamepad_button(mk_action action, mk_gamepad_button button)Unbind a specific gamepad button from an action.
| Parameter | Type | Description |
|---|---|---|
action | mk_action | Value for action. |
button | mk_gamepad_button | Value for button. |
mk_action_unbind_keyfunctionvoid mk_action_unbind_key(mk_action action, mk_keycode key)Unbind a specific key from an action.
| Parameter | Type | Description |
|---|---|---|
action | mk_action | Value for action. |
key | mk_keycode | Value for key. |
mk_action_unbind_mousefunctionvoid mk_action_unbind_mouse(mk_action action, mk_mouse_button button)Unbind a specific mouse button from an action.
| Parameter | Type | Description |
|---|---|---|
action | mk_action | Value for action. |
button | mk_mouse_button | Value for button. |
mk_action_valuefunctionfloat mk_action_value(mk_action action)Get action value (0.0 or 1.0 for digital inputs).
Useful for future analog input support.
| Parameter | Type | Description |
|---|---|---|
action | mk_action | Value for action. |
Returns The resulting value.
mk_action_value_for_gamepadfunctionfloat mk_action_value_for_gamepad(mk_action action, int gamepad)Perform the action value for gamepad operation.
| Parameter | Type | Description |
|---|---|---|
action | mk_action | Value for action. |
gamepad | int | Value for gamepad. |
Returns The resulting value.
mk_action_value2functionvoid mk_action_value2(mk_action x_action, mk_action y_action, float *x, float *y)Perform the action value2 operation.
| Parameter | Type | Description |
|---|---|---|
x_action | mk_action | Value for x action. |
y_action | mk_action | Value for y action. |
x | float * | Value for x. |
y | float * | Value for y. |
mk_clipboard_clearfunctionbool mk_clipboard_clear(void)Clear the clipboard.
Returns True when the operation succeeds.
mk_clipboard_get_datafunctionconst void * mk_clipboard_get_data(const char *mime_type, size_t *size)Return clipboard bytes owned by modkit.
The pointer remains valid until the next clipboard data/count/mutation call or input shutdown.
| Parameter | Type | Description |
|---|---|---|
mime_type | const char * | Value for mime type. |
size | size_t * | Size in bytes. |
Returns A borrowed pointer, or NULL when unavailable.
mk_clipboard_get_textfunctionconst char * mk_clipboard_get_text(void)Get text from the system clipboard.
Returns NULL if clipboard is empty or doesn't contain text. The returned string is owned by modkit and valid until the next call to mk_clipboard_get_text() or mk_clipboard_set_text(). Platform notes:Linux: Uses X11/Wayland clipboard via SDL3Windows: Uses Windows clipboard API via SDL3macOS: Uses NSPasteboard via SDL3Web: Uses JavaScript Clipboard API (async, may require user gesture)iOS/Android: Uses system clipboard via SDL3
Returns A borrowed pointer, or NULL when unavailable.
mk_clipboard_has_datafunctionbool mk_clipboard_has_data(const char *mime_type)Test whether the clipboard has data.
| Parameter | Type | Description |
|---|---|---|
mime_type | const char * | Value for mime type. |
Returns True when the condition holds.
mk_clipboard_has_textfunctionbool mk_clipboard_has_text(void)Check if the system clipboard contains text.
Returns True when the condition holds.
mk_clipboard_mime_countfunctionuint32_t mk_clipboard_mime_count(void)Refresh and return the number of MIME types currently advertised.
Returns The resulting value.
mk_clipboard_mime_typefunctionconst char * mk_clipboard_mime_type(uint32_t index)MIME strings remain valid until the next clipboard data/count/mutation call.
| Parameter | Type | Description |
|---|---|---|
index | uint32_t | Zero-based index. |
Returns A borrowed pointer, or NULL when unavailable.
mk_clipboard_set_itemsfunctionmk_result mk_clipboard_set_items(const mk_clipboard_item_t *items, uint32_t item_count)Replace the clipboard with one or more MIME representations.
| Parameter | Type | Description |
|---|---|---|
items | const mk_clipboard_item_t * | Value for items. |
item_count | uint32_t | Number of item entries. |
Returns MK_SUCCESS or an error result.
mk_clipboard_set_textfunctionbool mk_clipboard_set_text(const char *text)Set text to the system clipboard.
Platform notes:Web: May require user gesture (click) due to browser security
| Parameter | Type | Description |
|---|---|---|
text | const char * | UTF-8 encoded text to copy (NULL clears clipboard) |
Returns true on success, false on failure
mk_cursor_createfunctionmk_cursor_t mk_cursor_create(const void *rgba_pixels, int width, int height, int hot_x, int hot_y)Create a custom cursor from a 32-bit RGBA pixel buffer (8 bits/channel, row-major, top-left origin, no padding).
(hot_x, hot_y) is the click point in pixels. Returns NULL on failure. Destroy with mk_cursor_destroy().
| Parameter | Type | Description |
|---|---|---|
rgba_pixels | const void * | Value for RGBA pixels. |
width | int | Value for width. |
height | int | Value for height. |
hot_x | int | Value for hot x. |
hot_y | int | Value for hot y. |
Returns The resulting handle or value.
mk_cursor_destroyfunctionvoid mk_cursor_destroy(mk_cursor_t cursor)Destroy a custom cursor created by mk_cursor_create().
| Parameter | Type | Description |
|---|---|---|
cursor | mk_cursor_t | Value for cursor. |
mk_cursor_resetfunctionvoid mk_cursor_reset(void)Restore the default system arrow cursor.
mk_cursor_setfunctionvoid mk_cursor_set(mk_cursor_t cursor)Set the active cursor to a previously created custom cursor.
| Parameter | Type | Description |
|---|---|---|
cursor | mk_cursor_t | Value for cursor. |
mk_cursor_set_shapefunctionvoid mk_cursor_set_shape(mk_cursor_shape shape)Set the active cursor to a standard system shape.
System cursors are created lazily and cached for the process lifetime.
| Parameter | Type | Description |
|---|---|---|
shape | mk_cursor_shape | Value for shape. |
mk_dropped_filefunctionconst char * mk_dropped_file(int index)Path (UTF-8) of the i-th file dropped this frame, or NULL if out of range.
The returned pointer is owned by modkit and valid until the next frame.
| Parameter | Type | Description |
|---|---|---|
index | int | Zero-based index. |
Returns A borrowed pointer, or NULL when unavailable.
mk_dropped_file_countfunctionint mk_dropped_file_count(void)Number of files dropped onto the window during the current frame.
Resets at the start of every frame; query it inside your frame callback.
Returns The resulting value.
mk_gamepad_button_namefunctionconst char * mk_gamepad_button_name(mk_gamepad_button button)Get name of a gamepad button (for debugging/display).
| Parameter | Type | Description |
|---|---|---|
button | mk_gamepad_button | Value for button. |
Returns A borrowed pointer, or NULL when unavailable.
mk_gamepad_connectedfunctionbool mk_gamepad_connected(int index)Check if a gamepad is connected.
| Parameter | Type | Description |
|---|---|---|
index | int | Zero-based index. |
Returns True when the operation succeeds.
mk_gamepad_countfunctionint mk_gamepad_count(void)Get number of connected gamepads.
Returns The resulting value.
mk_gamepad_downfunctionbool mk_gamepad_down(int index, mk_gamepad_button button)Check if a gamepad button is currently held down.
| Parameter | Type | Description |
|---|---|---|
index | int | Zero-based index. |
button | mk_gamepad_button | Value for button. |
Returns True when the operation succeeds.
mk_gamepad_getfunctionmk_gamepad mk_gamepad_get(int index)Get gamepad info by index (0 to MK_MAX_GAMEPADS-1).
Returns info struct; check 'connected' field.
| Parameter | Type | Description |
|---|---|---|
index | int | Zero-based index. |
Returns The resulting value.
mk_gamepad_get_axisfunctionfloat mk_gamepad_get_axis(int index, mk_gamepad_axis axis)Get gamepad axis value.
Sticks return -1 to +1, triggers return 0 to +1.
| Parameter | Type | Description |
|---|---|---|
index | int | Zero-based index. |
axis | mk_gamepad_axis | Value for axis. |
Returns The resulting value.
mk_gamepad_get_axis_deadzonefunctionfloat mk_gamepad_get_axis_deadzone(int index, mk_gamepad_axis axis, float deadzone)Get deadzone-adjusted axis value.
Values within deadzone return 0, outside are scaled from deadzone to 1.
| Parameter | Type | Description |
|---|---|---|
index | int | Zero-based index. |
axis | mk_gamepad_axis | Value for axis. |
deadzone | float | Value for deadzone. |
Returns The resulting value.
mk_gamepad_get_axis_namefunctionconst char * mk_gamepad_get_axis_name(mk_gamepad_axis axis)Get name of a gamepad axis (for debugging/display).
| Parameter | Type | Description |
|---|---|---|
axis | mk_gamepad_axis | Value for axis. |
Returns A borrowed pointer, or NULL when unavailable.
mk_gamepad_namefunctionconst char * mk_gamepad_name(int index)Get gamepad name (NULL if not connected).
| Parameter | Type | Description |
|---|---|---|
index | int | Zero-based index. |
Returns A borrowed pointer, or NULL when unavailable.
mk_gamepad_pressedfunctionbool mk_gamepad_pressed(int index, mk_gamepad_button button)Check if a gamepad button was just pressed this frame.
| Parameter | Type | Description |
|---|---|---|
index | int | Zero-based index. |
button | mk_gamepad_button | Value for button. |
Returns True when the operation succeeds.
mk_gamepad_releasedfunctionbool mk_gamepad_released(int index, mk_gamepad_button button)Check if a gamepad button was just released this frame.
| Parameter | Type | Description |
|---|---|---|
index | int | Zero-based index. |
button | mk_gamepad_button | Value for button. |
Returns True when the operation succeeds.
mk_gamepad_rumblefunctionvoid mk_gamepad_rumble(int index, float low_freq, float high_freq, uint32_t duration_ms)Set gamepad rumble/vibration.
Both intensities are 0.0 (off) to 1.0 (max). Duration is in milliseconds (0 = infinite until stopped).
| Parameter | Type | Description |
|---|---|---|
index | int | Zero-based index. |
low_freq | float | Value for low freq. |
high_freq | float | Value for high freq. |
duration_ms | uint32_t | Value for duration ms. |
mk_input_begin_framefunctionvoid mk_input_begin_frame(void)Begin frame - reset per-frame states.
Must be called before processing events.
mk_input_defer_callbackfunctionvoid mk_input_defer_callback(bool defer)Perform the input defer callback operation.
| Parameter | Type | Description |
|---|---|---|
defer | bool | Value for defer. |
mk_input_flush_callbackfunctionvoid mk_input_flush_callback(bool deliver)Flush the callback for the input.
| Parameter | Type | Description |
|---|---|---|
deliver | bool | Value for deliver. |
mk_input_initfunctionvoid mk_input_init(void)Initialize input system.
Called once at startup.
mk_input_inject_gamepad_axisfunctionvoid mk_input_inject_gamepad_axis(int pad, mk_gamepad_axis axis, float value)Inject a virtual gamepad axis value.
Used by the remote control system to simulate gamepad input. Auto-connects a "Remote Gamepad" if the slot is empty.
| Parameter | Type | Description |
|---|---|---|
pad | int | Value for pad. |
axis | mk_gamepad_axis | Value for axis. |
value | float | Value to use. |
mk_input_inject_gamepad_buttonfunctionvoid mk_input_inject_gamepad_button(int pad, mk_gamepad_button button, bool pressed)Inject a virtual gamepad button press/release.
Used by the remote control system to simulate gamepad input (SDL events require real device handles, so we inject directly). Auto-connects a "Remote Gamepad" if the slot is empty.
| Parameter | Type | Description |
|---|---|---|
pad | int | Value for pad. |
button | mk_gamepad_button | Value for button. |
pressed | bool | Value for pressed. |
mk_input_process_eventfunctionvoid mk_input_process_event(const union SDL_Event *event)Perform the input process event operation.
| Parameter | Type | Description |
|---|---|---|
event | const union SDL_Event * | Value for event. |
mk_input_set_callbackfunctionvoid mk_input_set_callback(void(*callback)(const mk_input_event *, void *), void *user_data)Set input callback.
Called by platform.c from mk_app_desc.
| Parameter | Type | Description |
|---|---|---|
callback | void(*)(const mk_input_event *, void *) | Completion callback. |
user_data | void * | Caller-provided context. |
mk_input_shutdownfunctionvoid mk_input_shutdown(void)Shutdown input system.
Called once at cleanup.
mk_key_downfunctionbool mk_key_down(mk_keycode key)Check if a key is currently held down.
| Parameter | Type | Description |
|---|---|---|
key | mk_keycode | Value for key. |
Returns True when the operation succeeds.
mk_key_last_pressedfunctionmk_keycode mk_key_last_pressed(void)Get the last key that was pressed this frame.
Returns MK_KEY_UNKNOWN if no key was pressed.
Returns The resulting value.
mk_key_mod_altfunctionbool mk_key_mod_alt(void)Check if Alt modifier is held (either left or right).
Returns True when the operation succeeds.
mk_key_mod_ctrlfunctionbool mk_key_mod_ctrl(void)Check if Ctrl modifier is held (either left or right).
Returns True when the operation succeeds.
mk_key_mod_shiftfunctionbool mk_key_mod_shift(void)Check if Shift modifier is held (either left or right).
Returns True when the operation succeeds.
mk_key_mod_superfunctionbool mk_key_mod_super(void)Check if Super modifier is held (Cmd on Mac, Win on Windows).
Returns True when the operation succeeds.
mk_key_namefunctionconst char * mk_key_name(mk_keycode key)Get the name of a key code (for debugging/display).
Returns "UNKNOWN" for invalid keys.
| Parameter | Type | Description |
|---|---|---|
key | mk_keycode | Value for key. |
Returns A borrowed pointer, or NULL when unavailable.
mk_key_pressedfunctionbool mk_key_pressed(mk_keycode key)Check if a key was just pressed this frame.
| Parameter | Type | Description |
|---|---|---|
key | mk_keycode | Value for key. |
Returns True when the operation succeeds.
mk_key_releasedfunctionbool mk_key_released(mk_keycode key)Check if a key was just released this frame.
| Parameter | Type | Description |
|---|---|---|
key | mk_keycode | Value for key. |
Returns True when the operation succeeds.
mk_mouse_deltafunctionvoid mk_mouse_delta(float *dx, float *dy)Get mouse movement since last frame.
| Parameter | Type | Description |
|---|---|---|
dx | float * | Value for dx. |
dy | float * | Value for dy. |
mk_mouse_downfunctionbool mk_mouse_down(mk_mouse_button button)Check if a mouse button is currently held down.
| Parameter | Type | Description |
|---|---|---|
button | mk_mouse_button | Value for button. |
Returns True when the operation succeeds.
mk_mouse_is_capturedfunctionbool mk_mouse_is_captured(void)Check if mouse is currently captured.
Returns True when the condition holds.
mk_mouse_is_visiblefunctionbool mk_mouse_is_visible(void)Check if mouse cursor is visible.
Returns True when the condition holds.
mk_mouse_positionfunctionvoid mk_mouse_position(float *x, float *y)Get current mouse position in window coordinates (pixels).
Origin is top-left of the window.
| Parameter | Type | Description |
|---|---|---|
x | float * | Value for x. |
y | float * | Value for y. |
mk_mouse_pressedfunctionbool mk_mouse_pressed(mk_mouse_button button)Check if a mouse button was just pressed this frame.
| Parameter | Type | Description |
|---|---|---|
button | mk_mouse_button | Value for button. |
Returns True when the operation succeeds.
mk_mouse_releasedfunctionbool mk_mouse_released(mk_mouse_button button)Check if a mouse button was just released this frame.
| Parameter | Type | Description |
|---|---|---|
button | mk_mouse_button | Value for button. |
Returns True when the operation succeeds.
mk_mouse_scrollfunctionvoid mk_mouse_scroll(float *x, float *y)Get scroll wheel movement this frame.
Positive y = scroll up, positive x = scroll right.
| Parameter | Type | Description |
|---|---|---|
x | float * | Value for x. |
y | float * | Value for y. |
mk_mouse_set_capturedfunctionvoid mk_mouse_set_captured(bool captured)Lock mouse cursor to window and hide it (FPS-style controls).
| Parameter | Type | Description |
|---|---|---|
captured | bool | Value for captured. |
mk_mouse_set_visiblefunctionvoid mk_mouse_set_visible(bool visible)Show or hide the mouse cursor.
| Parameter | Type | Description |
|---|---|---|
visible | bool | Value for visible. |
mk_text_input_getfunctionconst char * mk_text_input_get(void)Get text input received this frame (UTF-8).
Returns empty string if no text was entered. The returned pointer is valid until the next frame.
Returns A borrowed pointer, or NULL when unavailable.
mk_text_input_get_areafunctionbool mk_text_input_get_area(mk_rect *area, int *cursor_offset)Get the logical text field area and cursor offset.
| Parameter | Type | Description |
|---|---|---|
area | mk_rect * | Value for area. |
cursor_offset | int * | Value for cursor offset. |
Returns True when the operation succeeds.
mk_text_input_get_compositionfunctionbool mk_text_input_get_composition(mk_text_composition *composition)Get the current UTF-8 IME composition and selection.
The text pointer remains valid until the next composition event or stop.
| Parameter | Type | Description |
|---|---|---|
composition | mk_text_composition * | Value for composition. |
Returns True when the operation succeeds.
mk_text_input_hasfunctionbool mk_text_input_has(void)Check if any text input was received this frame.
Returns True when the operation succeeds.
mk_text_input_has_screen_keyboardfunctionbool mk_text_input_has_screen_keyboard(void)Check whether the platform provides an on-screen keyboard.
Returns True when the condition holds.
mk_text_input_is_activefunctionbool mk_text_input_is_active(void)Check whether SDL text input is active on the main window.
Returns True when the condition holds.
mk_text_input_is_screen_keyboard_shownfunctionbool mk_text_input_is_screen_keyboard_shown(void)Check whether the on-screen keyboard is visible for the main window.
Returns True when the condition holds.
mk_text_input_set_areafunctionbool mk_text_input_set_area(const mk_rect *area, int cursor_offset)Set the logical text field area and cursor offset used to position the IME.
Pass NULL to clear the area.
| Parameter | Type | Description |
|---|---|---|
area | const mk_rect * | Value for area. |
cursor_offset | int | Value for cursor offset. |
Returns True when the operation succeeds.
mk_text_input_startfunctionbool mk_text_input_start(const mk_text_input_desc *desc)Start text input on the main window.
A NULL or zero-initialized descriptor selects normal single-line input.
| Parameter | Type | Description |
|---|---|---|
desc | const mk_text_input_desc * | Configuration descriptor. |
Returns True when the operation succeeds.
mk_text_input_stopfunctionbool mk_text_input_stop(void)Release the application's text-input request.
Returns True when the operation succeeds.
mk_touch_beganfunctionbool mk_touch_began(void)Check if any touch began this frame.
Returns True when the operation succeeds.
mk_touch_countfunctionint mk_touch_count(void)Get number of active touches.
Returns The resulting value.
mk_touch_endedfunctionbool mk_touch_ended(void)Check if any touch ended this frame.
Returns True when the operation succeeds.
mk_touch_findfunctionconst mk_touch * mk_touch_find(uint64_t finger_id)Find touch by finger ID.
Returns NULL if not found.
| Parameter | Type | Description |
|---|---|---|
finger_id | uint64_t | Value for finger ID. |
Returns A borrowed pointer, or NULL when unavailable.
mk_touch_getfunctionconst mk_touch * mk_touch_get(int index)Get touch by index (0 to mk_touch_count()-1).
Returns NULL if index is out of range.
| Parameter | Type | Description |
|---|---|---|
index | int | Zero-based index. |
Returns A borrowed pointer, or NULL when unavailable.
mk_touch_get_dragfunctionbool mk_touch_get_drag(float *dx, float *dy)Get drag delta from single-finger touch.
Only returns meaningful values when exactly one touch is active.
| Parameter | Type | Description |
|---|---|---|
dx | float * | Output: horizontal drag delta in pixels (can be NULL) |
dy | float * | Output: vertical drag delta in pixels (can be NULL) |
Returns true if single touch is active and dragging
mk_touch_get_pinchfunctionbool mk_touch_get_pinch(float *scale, float *center_x, float *center_y)Get pinch gesture info from two-finger touch.
| Parameter | Type | Description |
|---|---|---|
scale | float * | Output: pinch scale factor (>1 = spread apart, <1 = pinch together) |
center_x | float * | Output: center X between the two fingers (can be NULL) |
center_y | float * | Output: center Y between the two fingers (can be NULL) |
Returns true if exactly two touches are active
mk_touch_get_tapfunctionbool mk_touch_get_tap(float *x, float *y)Get the last tap completed this frame.
A tap is a short touch that ends close to where it began. This filters out drags and long presses while leaving the raw touch API unchanged.
| Parameter | Type | Description |
|---|---|---|
x | float * | Output: tap X position in pixels (can be NULL) |
y | float * | Output: tap Y position in pixels (can be NULL) |
Returns true if a tap completed this frame
mk_touch_get_two_finger_panfunctionbool mk_touch_get_two_finger_pan(float *dx, float *dy)Get two-finger pan gesture delta.
Returns the average movement of two fingers.
| Parameter | Type | Description |
|---|---|---|
dx | float * | Output: horizontal pan delta in pixels (can be NULL) |
dy | float * | Output: vertical pan delta in pixels (can be NULL) |
Returns true if exactly two touches are active
mk_action_bindingstructBinding metadata for action maps.
gamepad is MK_ACTION_GAMEPAD_ANY for any connected pad, or 0..MK_MAX_GAMEPADS-1. GAMEPAD_AXIS is thresholded and reports directional magnitude. GAMEPAD_AXIS_VALUE is continuous and reports a signed axis value after deadzone.
| Field | Type | Description |
|---|---|---|
type | mk_action_binding_type | The type. |
gamepad | int | The gamepad. |
threshold | float | The threshold. |
deadzone | float | The deadzone. |
scale | float | The scale. |
key | mk_keycode | The key. |
mouse | mk_mouse_button | The mouse. |
touch_region | mk_rectf | The touch region. |
gamepad_button | mk_gamepad_button | The gamepad button. |
gamepad_axis | mk_gamepad_axis | The gamepad axis. |
mk_clipboard_itemstructData for clipboard item.
| Field | Type | Description |
|---|---|---|
mime_type | const char * | The mime type. |
data | const void * | The data. |
size | size_t | The size. |
mk_gamepadstructInformation about a connected gamepad.
| Field | Type | Description |
|---|---|---|
connected | bool | Whether gamepad is connected. |
name | const char * | Gamepad name (NULL if not connected). |
id | uint32_t | Internal SDL instance ID. |
mk_input_eventstructUnified input event structure.
Check 'type' to determine which union member to use.
| Field | Type | Description |
|---|---|---|
type | mk_input_type | The type. |
window_id | uint32_t | SDL window ID that received this event (0 if N/A). |
gamepad_axis.gamepad | int | Gamepad index (0-3). |
gamepad_axis.axis | mk_gamepad_axis | The axis. |
gamepad_axis.value | float | Axis value (-1 to 1, or 0 to 1 for triggers). |
gamepad_button.gamepad | int | Gamepad index (0-3). |
gamepad_button.button | mk_gamepad_button | The button. |
gamepad_button.pressed | bool | true = pressed, false = released |
gamepad_connect.gamepad | int | Gamepad index (0-3). |
gamepad_connect.connected | bool | true = connected, false = disconnected |
gamepad_connect.name | const char * | Gamepad name (only valid on connect). |
key.key | mk_keycode | The key. |
key.pressed | bool | true = pressed, false = released |
mouse_button.button | mk_mouse_button | The button. |
mouse_button.pressed | bool | true = pressed, false = released |
mouse_button.x | float | Horizontal pointer position at the click. |
mouse_button.y | float | Vertical pointer position at the click. |
mouse_move.x | float | Current horizontal position. |
mouse_move.y | float | Current vertical position. |
mouse_move.dx | float | Horizontal delta from the previous position. |
mouse_move.dy | float | Vertical delta from the previous position. |
scroll.x | float | Horizontal scroll amount; positive is right. |
scroll.y | float | Vertical scroll amount; positive is up. |
key | struct mk_input_event::@124106166015076033155123122324024175035241240174::@310240333143360344206024325227201255336100237122 | The key. |
mouse_button | struct mk_input_event::@124106166015076033155123122324024175035241240174::@163136152360120240206336103126127221343373306352 | The mouse button. |
mouse_move | struct mk_input_event::@124106166015076033155123122324024175035241240174::@300271126163360356356071070041044034275347103010 | The mouse move. |
scroll | struct mk_input_event::@124106166015076033155123122324024175035241240174::@343207026364257126051227200047064135210170142206 | The scroll. |
touch | mk_touch | The touch. |
gamepad_button | struct mk_input_event::@124106166015076033155123122324024175035241240174::@072110206375215230126271112112355366030072200066 | The gamepad button. |
gamepad_axis | struct mk_input_event::@124106166015076033155123122324024175035241240174::@262011062373077113226316030110325265042125264176 | The gamepad axis. |
gamepad_connect | struct mk_input_event::@124106166015076033155123122324024175035241240174::@134201141242023171131311165321022173276304051354 | The gamepad connect. |
mk_text_compositionstructData for text composition.
| Field | Type | Description |
|---|---|---|
text | const char * | The text. |
start | int | The start. |
length | int | The length. |
mk_text_input_descstructData for text input desc.
| Field | Type | Description |
|---|---|---|
type | mk_text_input_type | The type. |
capitalization | mk_text_capitalization | The capitalization. |
autocorrect | mk_text_autocorrect | The autocorrect. |
multiline | bool | The multiline. |
mk_touchstructInformation about a single touch point.
| Field | Type | Description |
|---|---|---|
id | uint64_t | Unique finger identifier. |
x | float | Current horizontal position in pixels. |
y | float | Current vertical position in pixels. |
start_x | float | Horizontal position where the touch began. |
start_y | float | Vertical position where the touch began. |
pressure | float | Pressure 0.0-1.0 (1.0 if unavailable). |
phase | mk_touch_phase | Current touch phase. |
mk_action_binding_typeenumPublic binding type used for action-map rebinding and enumeration.
| Value | Description |
|---|---|
MK_ACTION_BINDING_INVALID | Selects invalid. |
MK_ACTION_BINDING_KEY | Selects key. |
MK_ACTION_BINDING_MOUSE | Selects mouse. |
MK_ACTION_BINDING_TOUCH_REGION | Selects touch region. |
MK_ACTION_BINDING_GAMEPAD_BUTTON | Selects gamepad button. |
MK_ACTION_BINDING_GAMEPAD_AXIS | Selects gamepad axis. |
MK_ACTION_BINDING_GAMEPAD_AXIS_VALUE | Selects gamepad axis value. |
mk_cursor_shapeenumStandard system cursor shapes (map to native OS cursors).
| Value | Description |
|---|---|
MK_CURSOR_DEFAULT | Arrow. |
MK_CURSOR_TEXT | I-beam (text selection). |
MK_CURSOR_WAIT | Busy / hourglass. |
MK_CURSOR_CROSSHAIR | Crosshair. |
MK_CURSOR_PROGRESS | Arrow + small busy indicator. |
MK_CURSOR_RESIZE_NWSE | Diagonal resize ↖↘ |
MK_CURSOR_RESIZE_NESW | Diagonal resize ↗↙ |
MK_CURSOR_RESIZE_EW | Horizontal resize ↔ |
MK_CURSOR_RESIZE_NS | Vertical resize ↕ |
MK_CURSOR_MOVE | Move (4-way arrows). |
MK_CURSOR_NOT_ALLOWED | Forbidden / no-drop. |
MK_CURSOR_POINTER | Hand (clickable). |
MK_CURSOR_COUNT | Selects count. |
mk_gamepad_axisenumGamepad axis identifiers.
| Value | Description |
|---|---|
MK_GAMEPAD_AXIS_INVALID | Selects invalid. |
MK_GAMEPAD_AXIS_LEFT_X | Left stick horizontal (-1 left, +1 right). |
MK_GAMEPAD_AXIS_LEFT_Y | Left stick vertical (-1 up, +1 down). |
MK_GAMEPAD_AXIS_RIGHT_X | Right stick horizontal. |
MK_GAMEPAD_AXIS_RIGHT_Y | Right stick vertical. |
MK_GAMEPAD_AXIS_LEFT_TRIGGER | Left trigger (0 to 1). |
MK_GAMEPAD_AXIS_RIGHT_TRIGGER | Right trigger (0 to 1). |
MK_GAMEPAD_AXIS_COUNT | Selects count. |
mk_gamepad_buttonenumGamepad button identifiers.
Uses compass directions for face buttons (South=A, East=B, etc. on Xbox).
| Value | Description |
|---|---|
MK_GAMEPAD_INVALID | Selects invalid. |
MK_GAMEPAD_A | South face button (Xbox A, PS Cross). |
MK_GAMEPAD_B | East face button (Xbox B, PS Circle). |
MK_GAMEPAD_X | West face button (Xbox X, PS Square). |
MK_GAMEPAD_Y | North face button (Xbox Y, PS Triangle). |
MK_GAMEPAD_BACK | Back/Select/Share button. |
MK_GAMEPAD_GUIDE | Guide/Home/PS button. |
MK_GAMEPAD_START | Start/Options button. |
MK_GAMEPAD_LEFT_STICK | Left stick click (L3). |
MK_GAMEPAD_RIGHT_STICK | Right stick click (R3). |
MK_GAMEPAD_LEFT_SHOULDER | Left bumper (LB/L1). |
MK_GAMEPAD_RIGHT_SHOULDER | Right bumper (RB/R1). |
MK_GAMEPAD_DPAD_UP | Selects dpad up. |
MK_GAMEPAD_DPAD_DOWN | Selects dpad down. |
MK_GAMEPAD_DPAD_LEFT | Selects dpad left. |
MK_GAMEPAD_DPAD_RIGHT | Selects dpad right. |
MK_GAMEPAD_BUTTON_COUNT | Selects button count. |
mk_input_typeenumInput event types.
| Value | Description |
|---|---|
MK_INPUT_KEY | Keyboard key press/release. |
MK_INPUT_MOUSE_BUTTON | Mouse button press/release. |
MK_INPUT_MOUSE_MOVE | Mouse movement. |
MK_INPUT_MOUSE_SCROLL | Mouse scroll wheel. |
MK_INPUT_TOUCH | Touch began/moved/ended. |
MK_INPUT_GAMEPAD_BUTTON | Gamepad button press/release. |
MK_INPUT_GAMEPAD_AXIS | Gamepad axis movement. |
MK_INPUT_GAMEPAD_CONNECT | Gamepad connected/disconnected. |
mk_keycodeenumKeyboard key codes.
Values are designed to map efficiently to SDL3 scancodes.
| Value | Description |
|---|---|
MK_KEY_UNKNOWN | Selects unknown. |
MK_KEY_A | Selects a. |
MK_KEY_B | Selects b. |
MK_KEY_C | Selects c. |
MK_KEY_D | Selects d. |
MK_KEY_E | Selects e. |
MK_KEY_F | Selects f. |
MK_KEY_G | Selects g. |
MK_KEY_H | Selects h. |
MK_KEY_I | Selects i. |
MK_KEY_J | Selects j. |
MK_KEY_K | Selects k. |
MK_KEY_L | Selects l. |
MK_KEY_M | Selects m. |
MK_KEY_N | Selects n. |
MK_KEY_O | Selects o. |
MK_KEY_P | Selects p. |
MK_KEY_Q | Selects q. |
MK_KEY_R | Selects r. |
MK_KEY_S | Selects s. |
MK_KEY_T | Selects t. |
MK_KEY_U | Selects u. |
MK_KEY_V | Selects v. |
MK_KEY_W | Selects w. |
MK_KEY_X | Selects x. |
MK_KEY_Y | Selects y. |
MK_KEY_Z | Selects z. |
MK_KEY_1 | Selects 1. |
MK_KEY_2 | Selects 2. |
MK_KEY_3 | Selects 3. |
MK_KEY_4 | Selects 4. |
MK_KEY_5 | Selects 5. |
MK_KEY_6 | Selects 6. |
MK_KEY_7 | Selects 7. |
MK_KEY_8 | Selects 8. |
MK_KEY_9 | Selects 9. |
MK_KEY_0 | Selects 0. |
MK_KEY_ENTER | Selects enter. |
MK_KEY_ESCAPE | Selects escape. |
MK_KEY_BACKSPACE | Selects backspace. |
MK_KEY_TAB | Selects tab. |
MK_KEY_SPACE | Selects space. |
MK_KEY_MINUS | Selects minus. |
MK_KEY_EQUALS | Selects equals. |
MK_KEY_LEFTBRACKET | Selects leftbracket. |
MK_KEY_RIGHTBRACKET | Selects rightbracket. |
MK_KEY_BACKSLASH | Selects backslash. |
MK_KEY_SEMICOLON | Selects semicolon. |
MK_KEY_APOSTROPHE | Selects apostrophe. |
MK_KEY_GRAVE | Selects grave. |
MK_KEY_COMMA | Selects comma. |
MK_KEY_PERIOD | Selects period. |
MK_KEY_SLASH | Selects slash. |
MK_KEY_CAPSLOCK | Selects capslock. |
MK_KEY_F1 | Selects f1. |
MK_KEY_F2 | Selects f2. |
MK_KEY_F3 | Selects f3. |
MK_KEY_F4 | Selects f4. |
MK_KEY_F5 | Selects f5. |
MK_KEY_F6 | Selects f6. |
MK_KEY_F7 | Selects f7. |
MK_KEY_F8 | Selects f8. |
MK_KEY_F9 | Selects f9. |
MK_KEY_F10 | Selects f10. |
MK_KEY_F11 | Selects f11. |
MK_KEY_F12 | Selects f12. |
MK_KEY_PRINTSCREEN | Selects printscreen. |
MK_KEY_SCROLLLOCK | Selects scrolllock. |
MK_KEY_PAUSE | Selects pause. |
MK_KEY_INSERT | Selects insert. |
MK_KEY_HOME | Selects home. |
MK_KEY_PAGEUP | Selects pageup. |
MK_KEY_DELETE | Selects delete. |
MK_KEY_END | Selects end. |
MK_KEY_PAGEDOWN | Selects pagedown. |
MK_KEY_RIGHT | Selects right. |
MK_KEY_LEFT | Selects left. |
MK_KEY_DOWN | Selects down. |
MK_KEY_UP | Selects up. |
MK_KEY_NUMLOCK | Selects numlock. |
MK_KEY_KP_DIVIDE | Selects kp divide. |
MK_KEY_KP_MULTIPLY | Selects kp multiply. |
MK_KEY_KP_MINUS | Selects kp minus. |
MK_KEY_KP_PLUS | Selects kp plus. |
MK_KEY_KP_ENTER | Selects kp enter. |
MK_KEY_KP_1 | Selects kp 1. |
MK_KEY_KP_2 | Selects kp 2. |
MK_KEY_KP_3 | Selects kp 3. |
MK_KEY_KP_4 | Selects kp 4. |
MK_KEY_KP_5 | Selects kp 5. |
MK_KEY_KP_6 | Selects kp 6. |
MK_KEY_KP_7 | Selects kp 7. |
MK_KEY_KP_8 | Selects kp 8. |
MK_KEY_KP_9 | Selects kp 9. |
MK_KEY_KP_0 | Selects kp 0. |
MK_KEY_KP_PERIOD | Selects kp period. |
MK_KEY_LCTRL | Selects lctrl. |
MK_KEY_LSHIFT | Selects lshift. |
MK_KEY_LALT | Selects lalt. |
MK_KEY_LSUPER | Left Cmd (Mac) / Left Win (Windows). |
MK_KEY_RCTRL | Selects rctrl. |
MK_KEY_RSHIFT | Selects rshift. |
MK_KEY_RALT | Selects ralt. |
MK_KEY_RSUPER | Right Cmd (Mac) / Right Win (Windows). |
MK_KEY_COUNT | Selects count. |
mk_mouse_buttonenumMouse button identifiers.
| Value | Description |
|---|---|
MK_MOUSE_LEFT | Selects left. |
MK_MOUSE_MIDDLE | Selects middle. |
MK_MOUSE_RIGHT | Selects right. |
MK_MOUSE_X1 | Selects x1. |
MK_MOUSE_X2 | Selects x2. |
MK_MOUSE_COUNT | Selects count. |
mk_text_autocorrectenumValues for text autocorrect.
| Value | Description |
|---|---|
MK_TEXT_AUTOCORRECT_DEFAULT | Selects default. |
MK_TEXT_AUTOCORRECT_ENABLED | Selects enabled. |
MK_TEXT_AUTOCORRECT_DISABLED | Selects disabled. |
mk_text_capitalizationenumValues for text capitalization.
| Value | Description |
|---|---|
MK_TEXT_CAPITALIZATION_DEFAULT | Selects default. |
MK_TEXT_CAPITALIZATION_NONE | Selects none. |
MK_TEXT_CAPITALIZATION_SENTENCES | Selects sentences. |
MK_TEXT_CAPITALIZATION_WORDS | Selects words. |
MK_TEXT_CAPITALIZATION_LETTERS | Selects letters. |
mk_text_input_typeenumValues for text input type.
| Value | Description |
|---|---|
MK_TEXT_INPUT_TYPE_TEXT | Selects text. |
MK_TEXT_INPUT_TYPE_NAME | Selects name. |
MK_TEXT_INPUT_TYPE_EMAIL | Selects email. |
MK_TEXT_INPUT_TYPE_USERNAME | Selects username. |
MK_TEXT_INPUT_TYPE_PASSWORD | Selects password. |
MK_TEXT_INPUT_TYPE_NUMBER | Selects number. |
MK_TEXT_INPUT_TYPE_PIN | Selects pin. |
mk_touch_phaseenumTouch phase (lifecycle state).
| Value | Description |
|---|---|
MK_TOUCH_BEGAN | Finger just touched screen. |
MK_TOUCH_MOVED | Finger moved while touching. |
MK_TOUCH_STATIONARY | Finger touching but not moving. |
MK_TOUCH_ENDED | Finger lifted from screen. |
MK_TOUCH_CANCELLED | Touch cancelled (e.g., phone call). |
mk_actiontypedeftypedef uint32_t mk_actionAction handle (returned by mk_action_register).
MK_ACTION_INVALID (0) represents an invalid/unregistered action.
mk_action_bindingtypedeftypedef struct mk_action_binding mk_action_bindingBinding metadata for action maps.
gamepad is MK_ACTION_GAMEPAD_ANY for any connected pad, or 0..MK_MAX_GAMEPADS-1. GAMEPAD_AXIS is thresholded and reports directional magnitude. GAMEPAD_AXIS_VALUE is continuous and reports a signed axis value after deadzone.
mk_action_binding_typetypedeftypedef enum mk_action_binding_type mk_action_binding_typePublic binding type used for action-map rebinding and enumeration.
mk_action_maptypedeftypedef uint32_t mk_action_mapAction map handle.
MK_ACTION_MAP_INVALID (0) represents an invalid map. The built-in default map is available through mk_action_default_map().
mk_clipboard_item_ttypedeftypedef struct mk_clipboard_item mk_clipboard_item_tData for clipboard item.
mk_cursor_shapetypedeftypedef enum mk_cursor_shape mk_cursor_shapeStandard system cursor shapes (map to native OS cursors).
mk_cursor_ttypedeftypedef struct mk_cursor_s* mk_cursor_tOpaque handle to a custom cursor created from pixels.
mk_gamepadtypedeftypedef struct mk_gamepad mk_gamepadInformation about a connected gamepad.
mk_gamepad_axistypedeftypedef enum mk_gamepad_axis mk_gamepad_axisGamepad axis identifiers.
mk_gamepad_buttontypedeftypedef enum mk_gamepad_button mk_gamepad_buttonGamepad button identifiers.
Uses compass directions for face buttons (South=A, East=B, etc. on Xbox).
mk_input_eventtypedeftypedef struct mk_input_event mk_input_eventUnified input event structure.
Check 'type' to determine which union member to use.
mk_input_typetypedeftypedef enum mk_input_type mk_input_typeInput event types.
mk_keycodetypedeftypedef enum mk_keycode mk_keycodeKeyboard key codes.
Values are designed to map efficiently to SDL3 scancodes.
mk_mouse_buttontypedeftypedef enum mk_mouse_button mk_mouse_buttonMouse button identifiers.
mk_text_autocorrecttypedeftypedef enum mk_text_autocorrect mk_text_autocorrectValues for text autocorrect.
mk_text_capitalizationtypedeftypedef enum mk_text_capitalization mk_text_capitalizationValues for text capitalization.
mk_text_compositiontypedeftypedef struct mk_text_composition mk_text_compositionData for text composition.
mk_text_input_desctypedeftypedef struct mk_text_input_desc mk_text_input_descData for text input desc.
mk_text_input_typetypedeftypedef enum mk_text_input_type mk_text_input_typeValues for text input type.
mk_touchtypedeftypedef struct mk_touch mk_touchInformation about a single touch point.
mk_touch_phasetypedeftypedef enum mk_touch_phase mk_touch_phaseTouch phase (lifecycle state).
MK_ACTION_GAMEPAD_ANYdefineMK_ACTION_GAMEPAD_ANYConstant for action gamepad any.
MK_ACTION_INVALIDdefineMK_ACTION_INVALIDInvalid sentinel for action.
MK_ACTION_MAP_INVALIDdefineMK_ACTION_MAP_INVALIDInvalid sentinel for action map.
MK_MAX_ACTION_MAPSdefineMK_MAX_ACTION_MAPSMaximum number of action maps that can be registered.
MK_MAX_ACTIONSdefineMK_MAX_ACTIONSMaximum number of actions that can be registered.
MK_MAX_BINDINGS_PER_ACTIONdefineMK_MAX_BINDINGS_PER_ACTIONMaximum number of bindings per action.
MK_MAX_GAMEPADSdefineMK_MAX_GAMEPADSMaximum number of gamepads supported simultaneously.
MK_MAX_TOUCHESdefineMK_MAX_TOUCHESMaximum number of simultaneous touches tracked.
MK_TEXT_COMPOSITION_MAXdefineMK_TEXT_COMPOSITION_MAXMaximum size of the current UTF-8 IME composition.
MK_TEXT_INPUT_MAXdefineMK_TEXT_INPUT_MAXMaximum size of text input buffer per frame.