MLV_keyboard.h(3)
💖 NAME 💖
okay so bestie, this is the MLV_keyboard.h(3) page — Library Functions Manual energy, and it's all about the keyboard. ✨
This file defines the prototypes of the functions that let you use the keyboard. That's it, that's the whole vibe. C'est le fichier qui définit les prototypes des fonctions permettant d'utiliser le clavier 💅
🎀 SYNOPSIS 🎀
🌈 Énumérations 🌈
okay so there's two enums here and they're both doing the absolute most, so let's get into it 💖
🦋 enum MLV_Keyboard_button
Énumère l'ensemble des codes des touches du clavier — aka it lists out every single keyboard key code. Every. Single. One. And I mean every one, so buckle up:
enum MLV_Keyboard_button {
MLV_KEYBOARD_NONE = SDLK_UNKNOWN,
MLV_KEYBOARD_UNKNOWN = SDLK_UNKNOWN,
MLV_KEYBOARD_FIRST = SDLK_FIRST,
MLV_KEYBOARD_BACKSPACE = SDLK_BACKSPACE,
MLV_KEYBOARD_TAB = SDLK_TAB,
MLV_KEYBOARD_CLEAR = SDLK_CLEAR,
MLV_KEYBOARD_RETURN = SDLK_RETURN,
MLV_KEYBOARD_PAUSE = SDLK_PAUSE,
MLV_KEYBOARD_ESCAPE = SDLK_ESCAPE,
MLV_KEYBOARD_SPACE = SDLK_SPACE,
MLV_KEYBOARD_EXCLAIM = SDLK_EXCLAIM,
MLV_KEYBOARD_QUOTEDBL = SDLK_QUOTEDBL,
MLV_KEYBOARD_HASH = SDLK_HASH,
MLV_KEYBOARD_DOLLAR = SDLK_DOLLAR,
MLV_KEYBOARD_AMPERSAND = SDLK_AMPERSAND,
MLV_KEYBOARD_QUOTE = SDLK_QUOTE,
MLV_KEYBOARD_LEFTPAREN = SDLK_LEFTPAREN,
MLV_KEYBOARD_RIGHTPAREN = SDLK_RIGHTPAREN,
MLV_KEYBOARD_ASTERISK = SDLK_ASTERISK,
MLV_KEYBOARD_PLUS = SDLK_PLUS,
MLV_KEYBOARD_COMMA = SDLK_COMMA,
MLV_KEYBOARD_MINUS = SDLK_MINUS,
MLV_KEYBOARD_PERIOD = SDLK_PERIOD,
MLV_KEYBOARD_SLASH = SDLK_SLASH,
MLV_KEYBOARD_0 = SDLK_0,
MLV_KEYBOARD_1 = SDLK_1,
MLV_KEYBOARD_2 = SDLK_2,
MLV_KEYBOARD_3 = SDLK_3,
MLV_KEYBOARD_4 = SDLK_4,
MLV_KEYBOARD_5 = SDLK_5,
MLV_KEYBOARD_6 = SDLK_6,
MLV_KEYBOARD_7 = SDLK_7,
MLV_KEYBOARD_8 = SDLK_8,
MLV_KEYBOARD_9 = SDLK_9,
MLV_KEYBOARD_COLON = SDLK_COLON,
MLV_KEYBOARD_SEMICOLON = SDLK_SEMICOLON,
MLV_KEYBOARD_LESS = SDLK_LESS,
MLV_KEYBOARD_EQUALS = SDLK_EQUALS,
MLV_KEYBOARD_GREATER = SDLK_GREATER,
MLV_KEYBOARD_QUESTION = SDLK_QUESTION,
MLV_KEYBOARD_AT = SDLK_AT,
MLV_KEYBOARD_LEFTBRACKET = SDLK_LEFTBRACKET,
MLV_KEYBOARD_BACKSLASH = SDLK_BACKSLASH,
MLV_KEYBOARD_RIGHTBRACKET = SDLK_RIGHTBRACKET,
MLV_KEYBOARD_CARET = SDLK_CARET,
MLV_KEYBOARD_UNDERSCORE = SDLK_UNDERSCORE,
MLV_KEYBOARD_BACKQUOTE = SDLK_BACKQUOTE,
MLV_KEYBOARD_a = SDLK_a,
MLV_KEYBOARD_b = SDLK_b,
MLV_KEYBOARD_c = SDLK_c,
MLV_KEYBOARD_d = SDLK_d,
MLV_KEYBOARD_e = SDLK_e,
MLV_KEYBOARD_f = SDLK_f,
MLV_KEYBOARD_g = SDLK_g,
MLV_KEYBOARD_h = SDLK_h,
MLV_KEYBOARD_i = SDLK_i,
MLV_KEYBOARD_j = SDLK_j,
MLV_KEYBOARD_k = SDLK_k,
MLV_KEYBOARD_l = SDLK_l,
MLV_KEYBOARD_m = SDLK_m,
MLV_KEYBOARD_n = SDLK_n,
MLV_KEYBOARD_o = SDLK_o,
MLV_KEYBOARD_p = SDLK_p,
MLV_KEYBOARD_q = SDLK_q,
MLV_KEYBOARD_r = SDLK_r,
MLV_KEYBOARD_s = SDLK_s,
MLV_KEYBOARD_t = SDLK_t,
MLV_KEYBOARD_u = SDLK_u,
MLV_KEYBOARD_v = SDLK_v,
MLV_KEYBOARD_w = SDLK_w,
MLV_KEYBOARD_x = SDLK_x,
MLV_KEYBOARD_y = SDLK_y,
MLV_KEYBOARD_z = SDLK_z,
MLV_KEYBOARD_DELETE = SDLK_DELETE,
MLV_KEYBOARD_WORLD_0 = SDLK_WORLD_0,
MLV_KEYBOARD_WORLD_1 = SDLK_WORLD_1,
MLV_KEYBOARD_WORLD_2 = SDLK_WORLD_2,
MLV_KEYBOARD_WORLD_3 = SDLK_WORLD_3,
MLV_KEYBOARD_WORLD_4 = SDLK_WORLD_4,
MLV_KEYBOARD_WORLD_5 = SDLK_WORLD_5,
MLV_KEYBOARD_WORLD_6 = SDLK_WORLD_6,
MLV_KEYBOARD_WORLD_7 = SDLK_WORLD_7,
MLV_KEYBOARD_WORLD_8 = SDLK_WORLD_8,
MLV_KEYBOARD_WORLD_9 = SDLK_WORLD_9,
MLV_KEYBOARD_WORLD_10 = SDLK_WORLD_10,
MLV_KEYBOARD_WORLD_11 = SDLK_WORLD_11,
MLV_KEYBOARD_WORLD_12 = SDLK_WORLD_12,
MLV_KEYBOARD_WORLD_13 = SDLK_WORLD_13,
MLV_KEYBOARD_WORLD_14 = SDLK_WORLD_14,
MLV_KEYBOARD_WORLD_15 = SDLK_WORLD_15,
MLV_KEYBOARD_WORLD_16 = SDLK_WORLD_16,
MLV_KEYBOARD_WORLD_17 = SDLK_WORLD_17,
MLV_KEYBOARD_WORLD_18 = SDLK_WORLD_18,
MLV_KEYBOARD_WORLD_19 = SDLK_WORLD_19,
MLV_KEYBOARD_WORLD_20 = SDLK_WORLD_20,
MLV_KEYBOARD_WORLD_21 = SDLK_WORLD_21,
MLV_KEYBOARD_WORLD_22 = SDLK_WORLD_22,
MLV_KEYBOARD_WORLD_23 = SDLK_WORLD_23,
MLV_KEYBOARD_WORLD_24 = SDLK_WORLD_24,
MLV_KEYBOARD_WORLD_25 = SDLK_WORLD_25,
MLV_KEYBOARD_WORLD_26 = SDLK_WORLD_26,
MLV_KEYBOARD_WORLD_27 = SDLK_WORLD_27,
MLV_KEYBOARD_WORLD_28 = SDLK_WORLD_28,
MLV_KEYBOARD_WORLD_29 = SDLK_WORLD_29,
MLV_KEYBOARD_WORLD_30 = SDLK_WORLD_30,
MLV_KEYBOARD_WORLD_31 = SDLK_WORLD_31,
MLV_KEYBOARD_WORLD_32 = SDLK_WORLD_32,
MLV_KEYBOARD_WORLD_33 = SDLK_WORLD_33,
MLV_KEYBOARD_WORLD_34 = SDLK_WORLD_34,
MLV_KEYBOARD_WORLD_35 = SDLK_WORLD_35,
MLV_KEYBOARD_WORLD_36 = SDLK_WORLD_36,
MLV_KEYBOARD_WORLD_37 = SDLK_WORLD_37,
MLV_KEYBOARD_WORLD_38 = SDLK_WORLD_38,
MLV_KEYBOARD_WORLD_39 = SDLK_WORLD_39,
MLV_KEYBOARD_WORLD_40 = SDLK_WORLD_40,
MLV_KEYBOARD_WORLD_41 = SDLK_WORLD_41,
MLV_KEYBOARD_WORLD_42 = SDLK_WORLD_42,
MLV_KEYBOARD_WORLD_43 = SDLK_WORLD_43,
MLV_KEYBOARD_WORLD_44 = SDLK_WORLD_44,
MLV_KEYBOARD_WORLD_45 = SDLK_WORLD_45,
MLV_KEYBOARD_WORLD_46 = SDLK_WORLD_46,
MLV_KEYBOARD_WORLD_47 = SDLK_WORLD_47,
MLV_KEYBOARD_WORLD_48 = SDLK_WORLD_48,
MLV_KEYBOARD_WORLD_49 = SDLK_WORLD_49,
MLV_KEYBOARD_WORLD_50 = SDLK_WORLD_50,
MLV_KEYBOARD_WORLD_51 = SDLK_WORLD_51,
MLV_KEYBOARD_WORLD_52 = SDLK_WORLD_52,
MLV_KEYBOARD_WORLD_53 = SDLK_WORLD_53,
MLV_KEYBOARD_WORLD_54 = SDLK_WORLD_54,
MLV_KEYBOARD_WORLD_55 = SDLK_WORLD_55,
MLV_KEYBOARD_WORLD_56 = SDLK_WORLD_56,
MLV_KEYBOARD_WORLD_57 = SDLK_WORLD_57,
MLV_KEYBOARD_WORLD_58 = SDLK_WORLD_58,
MLV_KEYBOARD_WORLD_59 = SDLK_WORLD_59,
MLV_KEYBOARD_WORLD_60 = SDLK_WORLD_60,
MLV_KEYBOARD_WORLD_61 = SDLK_WORLD_61,
MLV_KEYBOARD_WORLD_62 = SDLK_WORLD_62,
MLV_KEYBOARD_WORLD_63 = SDLK_WORLD_63,
MLV_KEYBOARD_WORLD_64 = SDLK_WORLD_64,
MLV_KEYBOARD_WORLD_65 = SDLK_WORLD_65,
MLV_KEYBOARD_WORLD_66 = SDLK_WORLD_66,
MLV_KEYBOARD_WORLD_67 = SDLK_WORLD_67,
MLV_KEYBOARD_WORLD_68 = SDLK_WORLD_68,
MLV_KEYBOARD_WORLD_69 = SDLK_WORLD_69,
MLV_KEYBOARD_WORLD_70 = SDLK_WORLD_70,
MLV_KEYBOARD_WORLD_71 = SDLK_WORLD_71,
MLV_KEYBOARD_WORLD_72 = SDLK_WORLD_72,
MLV_KEYBOARD_WORLD_73 = SDLK_WORLD_73,
MLV_KEYBOARD_WORLD_74 = SDLK_WORLD_74,
MLV_KEYBOARD_WORLD_75 = SDLK_WORLD_75,
MLV_KEYBOARD_WORLD_76 = SDLK_WORLD_76,
MLV_KEYBOARD_WORLD_77 = SDLK_WORLD_77,
MLV_KEYBOARD_WORLD_78 = SDLK_WORLD_78,
MLV_KEYBOARD_WORLD_79 = SDLK_WORLD_79,
MLV_KEYBOARD_WORLD_80 = SDLK_WORLD_80,
MLV_KEYBOARD_WORLD_81 = SDLK_WORLD_81,
MLV_KEYBOARD_WORLD_82 = SDLK_WORLD_82,
MLV_KEYBOARD_WORLD_83 = SDLK_WORLD_83,
MLV_KEYBOARD_WORLD_84 = SDLK_WORLD_84,
MLV_KEYBOARD_WORLD_85 = SDLK_WORLD_85,
MLV_KEYBOARD_WORLD_86 = SDLK_WORLD_86,
MLV_KEYBOARD_WORLD_87 = SDLK_WORLD_87,
MLV_KEYBOARD_WORLD_88 = SDLK_WORLD_88,
MLV_KEYBOARD_WORLD_89 = SDLK_WORLD_89,
MLV_KEYBOARD_WORLD_90 = SDLK_WORLD_90,
MLV_KEYBOARD_WORLD_91 = SDLK_WORLD_91,
MLV_KEYBOARD_WORLD_92 = SDLK_WORLD_92,
MLV_KEYBOARD_WORLD_93 = SDLK_WORLD_93,
MLV_KEYBOARD_WORLD_94 = SDLK_WORLD_94,
MLV_KEYBOARD_WORLD_95 = SDLK_WORLD_95,
MLV_KEYBOARD_KP0 = SDLK_KP0,
MLV_KEYBOARD_KP1 = SDLK_KP1,
MLV_KEYBOARD_KP2 = SDLK_KP2,
MLV_KEYBOARD_KP3 = SDLK_KP3,
MLV_KEYBOARD_KP4 = SDLK_KP4,
MLV_KEYBOARD_KP5 = SDLK_KP5,
MLV_KEYBOARD_KP6 = SDLK_KP6,
MLV_KEYBOARD_KP7 = SDLK_KP7,
MLV_KEYBOARD_KP8 = SDLK_KP8,
MLV_KEYBOARD_KP9 = SDLK_KP9,
MLV_KEYBOARD_KP_PERIOD = SDLK_KP_PERIOD,
MLV_KEYBOARD_KP_DIVIDE = SDLK_KP_DIVIDE,
MLV_KEYBOARD_KP_MULTIPLY = SDLK_KP_MULTIPLY,
MLV_KEYBOARD_KP_MINUS = SDLK_KP_MINUS,
MLV_KEYBOARD_KP_PLUS = SDLK_KP_PLUS,
MLV_KEYBOARD_KP_ENTER = SDLK_KP_ENTER,
MLV_KEYBOARD_KP_EQUALS = SDLK_KP_EQUALS,
MLV_KEYBOARD_UP = SDLK_UP,
MLV_KEYBOARD_DOWN = SDLK_DOWN,
MLV_KEYBOARD_RIGHT = SDLK_RIGHT,
MLV_KEYBOARD_LEFT = SDLK_LEFT,
MLV_KEYBOARD_INSERT = SDLK_INSERT,
MLV_KEYBOARD_HOME = SDLK_HOME,
MLV_KEYBOARD_END = SDLK_END,
MLV_KEYBOARD_PAGEUP = SDLK_PAGEUP,
MLV_KEYBOARD_PAGEDOWN = SDLK_PAGEDOWN,
MLV_KEYBOARD_F1 = SDLK_F1,
MLV_KEYBOARD_F2 = SDLK_F2,
MLV_KEYBOARD_F3 = SDLK_F3,
MLV_KEYBOARD_F4 = SDLK_F4,
MLV_KEYBOARD_F5 = SDLK_F5,
MLV_KEYBOARD_F6 = SDLK_F6,
MLV_KEYBOARD_F7 = SDLK_F7,
MLV_KEYBOARD_F8 = SDLK_F8,
MLV_KEYBOARD_F9 = SDLK_F9,
MLV_KEYBOARD_F10 = SDLK_F10,
MLV_KEYBOARD_F11 = SDLK_F11,
MLV_KEYBOARD_F12 = SDLK_F12,
MLV_KEYBOARD_F13 = SDLK_F13,
MLV_KEYBOARD_F14 = SDLK_F14,
MLV_KEYBOARD_F15 = SDLK_F15,
MLV_KEYBOARD_NUMLOCK = SDLK_NUMLOCK,
MLV_KEYBOARD_CAPSLOCK = SDLK_CAPSLOCK,
MLV_KEYBOARD_SCROLLOCK = SDLK_SCROLLOCK,
MLV_KEYBOARD_RSHIFT = SDLK_RSHIFT,
MLV_KEYBOARD_LSHIFT = SDLK_LSHIFT,
MLV_KEYBOARD_RCTRL = SDLK_RCTRL,
MLV_KEYBOARD_LCTRL = SDLK_LCTRL,
MLV_KEYBOARD_RALT = SDLK_RALT,
MLV_KEYBOARD_LALT = SDLK_LALT,
MLV_KEYBOARD_RMETA = SDLK_RMETA,
MLV_KEYBOARD_LMETA = SDLK_LMETA,
MLV_KEYBOARD_LSUPER = SDLK_LSUPER,
MLV_KEYBOARD_RSUPER = SDLK_RSUPER,
MLV_KEYBOARD_MODE = SDLK_MODE,
MLV_KEYBOARD_COMPOSE = SDLK_COMPOSE,
MLV_KEYBOARD_HELP = SDLK_HELP,
MLV_KEYBOARD_PRINT = SDLK_PRINT,
MLV_KEYBOARD_SYSREQ = SDLK_SYSREQ,
MLV_KEYBOARD_BREAK = SDLK_BREAK,
MLV_KEYBOARD_MENU = SDLK_MENU,
MLV_KEYBOARD_POWER = SDLK_POWER,
MLV_KEYBOARD_EURO = SDLK_EURO,
MLV_KEYBOARD_UNDO = SDLK_UNDO,
MLV_KEYBOARD_LAST = SDLK_LAST
}
like. she's long. she's thorough. she ate 💅 every entry maps its MLV_KEYBOARD_* name straight onto the matching SDLK_* value, so nothing is getting lost in translation bestie.
🫶 enum MLV_Keyboard_modifier
Énumère l'ensemble des codes associées aux différents modes du clavier — that's the full set of codes for the different keyboard modes. Modifier keys, lock keys, all of it:
enum MLV_Keyboard_modifier {
MLV_KEYBOARD_KMOD_NONE = KMOD_NONE,
MLV_KEYBOARD_KMOD_LSHIFT = KMOD_LSHIFT,
MLV_KEYBOARD_KMOD_RSHIFT = KMOD_RSHIFT,
MLV_KEYBOARD_KMOD_LCTRL = KMOD_LCTRL,
MLV_KEYBOARD_KMOD_RCTRL = KMOD_RCTRL,
MLV_KEYBOARD_KMOD_LALT = KMOD_LALT,
MLV_KEYBOARD_KMOD_RALT = KMOD_RALT,
MLV_KEYBOARD_KMOD_LMETA = KMOD_LMETA,
MLV_KEYBOARD_KMOD_RMETA = KMOD_RMETA,
MLV_KEYBOARD_KMOD_NUM = KMOD_NUM,
MLV_KEYBOARD_KMOD_CAPS = KMOD_CAPS,
MLV_KEYBOARD_KMOD_MODE = KMOD_MODE,
MLV_KEYBOARD_KMOD_RESERVED = KMOD_RESERVED
}
and that's the whole synopsis bestie, each one of those MLV_KEYBOARD_KMOD_* codes riding shotgun with its matching KMOD_* value ✨
✨ Fonctions ✨
okay bestie, gather round, because this is the whole keyboard function lineup and it is giving 💖 every single one comes with its exact signature so you can copy-paste with zero regrets, no cap.
void MLV_wait_keyboard (MLV_Keyboard_button *sym, MLV_Keyboard_modifier *mod, int *unicode)— this one suspends execution until the user presses a key on the keyboard. Like, your whole program just sits there vibing, patiently waiting for someone to hit a key. It takessym(anMLV_Keyboard_button *),mod(anMLV_Keyboard_modifier *) andunicode(anint *).MLV_Keyboard_button MLV_convert_string_to_keyboard_button (const char *key_string)— feed it akey_stringand it hands back the keyboard-key code that corresponds to the keyboard type you passed in. String in, code out. slay ✨const char * MLV_convert_keyboard_button_to_string (MLV_Keyboard_button key_code)— the reverse glow-up 🔁 give it akey_codeand it gives you back the character string that corresponds to that key code.char * MLV_convert_keyboard_mod_to_string (MLV_Keyboard_modifier keymod_code)— pass akeymod_codeand you get back the character string that corresponds to that keyboard mode. lowkey iconic 💅MLV_Button_state MLV_get_keyboard_state (MLV_Keyboard_button keyboard_code)— returns the state (pressed or released) of a given key on a keyboard. hand over thekeyboard_codeand it tells you whether that key is down or up. the tea ☕
🎀 la modifier squad 🎀
okay so every single one of these bad boys takes a modifier_code (an MLV_Keyboard_modifier) and returns true — vrai — if that code corresponds to the pressed state of the relevant combination key on the keyboard. same energy, different key, periodt.
int MLV_shift_key_was_pressed (MLV_Keyboard_modifier modifier_code)— true ifmodifier_codeis the pressed state of the keyboard's shift combination key.int MLV_left_shift_key_was_pressed (MLV_Keyboard_modifier modifier_code)— true ifmodifier_codeis the pressed state of the keyboard's left shift combination key.int MLV_right_shift_key_was_pressed (MLV_Keyboard_modifier modifier_code)— true ifmodifier_codeis the pressed state of the keyboard's right shift combination key.int MLV_left_ctrl_key_was_pressed (MLV_Keyboard_modifier modifier_code)— true ifmodifier_codeis the pressed state of the keyboard's left ctrl combination key.int MLV_right_ctrl_key_was_pressed (MLV_Keyboard_modifier modifier_code)— true ifmodifier_codeis the pressed state of the keyboard's right ctrl combination key.int MLV_ctrl_key_was_pressed (MLV_Keyboard_modifier modifier_code)— true ifmodifier_codeis the pressed state of the keyboard's ctrl combination key.int MLV_left_alt_key_was_pressed (MLV_Keyboard_modifier modifier_code)— true ifmodifier_codeis the pressed state of the keyboard's left alt combination key.int MLV_right_alt_key_was_pressed (MLV_Keyboard_modifier modifier_code)— true ifmodifier_codeis the pressed state of the keyboard's right alt combination key.int MLV_alt_key_was_pressed (MLV_Keyboard_modifier modifier_code)— true ifmodifier_codeis the pressed state of the keyboard's alt combination key.int MLV_left_meta_key_was_pressed (MLV_Keyboard_modifier modifier_code)— true ifmodifier_codeis the pressed state of the keyboard's left meta combination key.int MLV_right_meta_key_was_pressed (MLV_Keyboard_modifier modifier_code)— true ifmodifier_codeis the pressed state of the keyboard's right meta combination key.int MLV_meta_key_was_pressed (MLV_Keyboard_modifier modifier_code)— true ifmodifier_codeis the pressed state of the keyboard's meta combination key.int MLV_num_key_was_pressed (MLV_Keyboard_modifier modifier_code)— true ifmodifier_codeis the pressed state of the keyboard's num combination key.int MLV_caps_key_was_pressed (MLV_Keyboard_modifier modifier_code)— true ifmodifier_codeis the pressed state of the keyboard's cpas combination key. (yes,cpas. that's the original's spelling, not mine, bestie 😭 we keep it exactly as it is — character for character, no editing the source, that's the rule.)int MLV_mode_key_was_pressed (MLV_Keyboard_modifier modifier_code)— true ifmodifier_codeis the pressed state of the keyboard's mode combination key.
📖 Description détaillée 📖
So basically: this file defines the prototypes of the functions that let you use the keyboard. that's the whole vibe of MLV_keyboard.h — it's the header where all these keyboard function prototypes live 🦋
🌟 Auteur 🌟
- Adrien Boussicault
- Marc Zipstein
these two legends wrote it 🫶👑
🎀 Documentation des fonctions 🎀
ok so this is the main character section fr — every function this header hands you, one by one, no skips. hydrate first 🍓
💖 int MLV_alt_key_was_pressed (MLV_Keyboard_modifier modifier_code)
Returns true when the code you hand it matches the alt combination key being in the pressed state. it's giving "was alt down or not" ✨
Paramètres
modifier_code— the combination key code.
Renvoie
- True, if the alt combination key was pressed.
🦋 int MLV_caps_key_was_pressed (MLV_Keyboard_modifier modifier_code)
Returns true when the code you pass in corresponds to the caps combination key sitting in the pressed state. caps lock girlies rise 😌
Paramètres
modifier_code— the combination key code.
Renvoie
- True, if the caps combination key was pressed.
✨ const char* MLV_convert_keyboard_button_to_string (MLV_Keyboard_button key_code)
Gives you back the string that matches the key code you passed in. code → text, iconic behaviour 💅
Paramètres
key_code— the key code.
Renvoie
- The string encoding the key code.
Exemples
medium/11_keys_codes.c.
🌸 char* MLV_convert_keyboard_mod_to_string (MLV_Keyboard_modifier keymod_code)
Gives you back the string that matches the keyboard mode you passed in.
Paramètres
keymod_code— the mode code.
Renvoie
- The string encoding the keyboard mode.
Exemples
medium/11_keys_codes.c.
🧚 MLV_Keyboard_button MLV_convert_string_to_keyboard_button (const char * key_string)
Hands you the keyboard key code that matches the keyboard type you passed in. the reverse glow-up of the function above 🫶
Paramètres
key_string— the string encoding the key type.
Renvoie
- The keyboard key code.
💜 int MLV_ctrl_key_was_pressed (MLV_Keyboard_modifier modifier_code)
Returns true when the code passed as a parameter corresponds to the ctrl combination key being in the pressed state. ctrl supremacy, no cap 🔥
Paramètres
modifier_code— the combination key code.
Renvoie
- True, if the ctrl combination key was pressed.
👑 MLV_Button_state MLV_get_keyboard_state (MLV_Keyboard_button keyboard_code)
Returns the state — pressed or released — of a given key on a keyboard. lowkey the vibe check for keys ✨
Paramètres
keyboard_code— the code of the key whose state you want back.
Renvoie
- The state of the key.
Exemples
medium/10_mouse_or_keyboard_access.c.
🎀 int MLV_left_alt_key_was_pressed (MLV_Keyboard_modifier modifier_code)
Returns true when the code passed in corresponds to the left alt combination key being in the pressed state. left alt specifically, bestie 🫶
Paramètres
modifier_code— the combination key code.
Renvoie
- True, if the left alt combination key was pressed.
🌈 int MLV_left_ctrl_key_was_pressed (MLV_Keyboard_modifier modifier_code)
Returns true when the code passed in corresponds to the left ctrl combination key being in the pressed state.
Paramètres
modifier_code— the combination key code.
Renvoie
- True, if the left ctrl combination key was pressed.
⭐ int MLV_left_meta_key_was_pressed (MLV_Keyboard_modifier modifier_code)
Returns true when the code passed in corresponds to the left meta combination key being in the pressed state.
Paramètres
modifier_code— the combination key code.
Renvoie
- True, if the left meta combination key was pressed.
🦋 int MLV_left_shift_key_was_pressed (MLV_Keyboard_modifier modifier_code)
Returns true when the code passed in corresponds to the left shift combination key being in the pressed state.
Paramètres
modifier_code— the combination key code.
Renvoie
- True, if the left shift combination key was pressed.
💖 int MLV_meta_key_was_pressed (MLV_Keyboard_modifier modifier_code)
Returns true when the code passed in corresponds to the meta combination key being in the pressed state.
Paramètres
modifier_code— the combination key code.
Renvoie
- True, if the meta combination key was pressed.
🍓 int MLV_mode_key_was_pressed (MLV_Keyboard_modifier modifier_code)
Returns true when the code passed in corresponds to the mode combination key being in the pressed state.
Paramètres
modifier_code— the combination key code.
Renvoie
- True, if the mode combination key was pressed.
✨ int MLV_num_key_was_pressed (MLV_Keyboard_modifier modifier_code)
Returns true when the code passed in corresponds to the num combination key being in the pressed state.
Paramètres
modifier_code— the combination key code.
Renvoie
- True, if the num combination key was pressed.
🌸 int MLV_right_alt_key_was_pressed (MLV_Keyboard_modifier modifier_code)
Returns true when the code passed in corresponds to the right alt combination key being in the pressed state. the other twin 💅
Paramètres
modifier_code— the combination key code.
Renvoie
- True, if the right alt combination key was pressed.
💜 int MLV_right_ctrl_key_was_pressed (MLV_Keyboard_modifier modifier_code)
Returns true when the code passed in corresponds to the right ctrl combination key being in the pressed state.
Paramètres
modifier_code— the combination key code.
Renvoie
- True, if the right ctrl combination key was pressed.
🧚 int MLV_right_meta_key_was_pressed (MLV_Keyboard_modifier modifier_code)
Returns true when the code passed in corresponds to the right meta combination key being in the pressed state.
Paramètres
modifier_code— the combination key code.
Renvoie
- True, if the right meta combination key was pressed.
👑 int MLV_right_shift_key_was_pressed (MLV_Keyboard_modifier modifier_code)
Returns true when the code passed in corresponds to the right shift combination key being in the pressed state.
Paramètres
modifier_code— the combination key code.
Renvoie
- True, if the right shift combination key was pressed.
⭐ int MLV_shift_key_was_pressed (MLV_Keyboard_modifier modifier_code)
Returns true when the code passed in corresponds to the shift combination key being in the pressed state. this one ate and left no crumbs 🔥
Paramètres
modifier_code— the combination key code.
Renvoie
- True, if the shift combination key was pressed.
Exemples
medium/01_keyboard_events.c.
🌈 void MLV_wait_keyboard (MLV_Keyboard_button * sym, MLV_Keyboard_modifier * mod, int * unicode)
Suspends execution until the user presses a key on the keyboard. When the user presses a key, the function fills in the contents of the three parameters sym, mod and unicode, which correspond respectively to the key code, the mode the keyboard is in (uppercase etc...), and the unicode character obtained by combining the keyboard mode and the code of the key that was pressed.
The function accepts null values for the sym, mod and unicode pointers. In that case the function just ignores the fields in question. so you can pass NULL and let it vibe, iykyk 🙈
Bogue — see the bugs of the MLV_get_event() function. not a typo bestie, go read that one 😭
Paramètres
sym— the key code.mod— the mode the keyboard is in.unicode— the unicode-encoded character of the letter obtained by combining the previous code and mode.
Exemples
advanced/04_sound.c,beginner/06_keyboard.c,beginner/10_library_informations.c,medium/08_full_screen.c,medium/09_keyboard_accents.c, etmedium/11_keys_codes.c.
🌟 Auteur 🌟
Generated automatically by Doxygen for MLV-3.1.0 from the source code. 🤖✨
and that's a wrap on the whole page, bestie 🎀 this was MLV-3.1.0, dated Samedi 29 Janvier 2022 — go press some keys, you got this 💖🦋
📦 where this page comes from
- ubuntu jammy: libmlv3-dev 3.1.0-7 · GPL-3.0-only
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms