summaryrefslogtreecommitdiff
path: root/include/yasl/keycodes.h
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-12 22:12:02 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-12 22:12:02 +0300
commit94c5e361fbb229b0cd6853e2102a7d95f1f358b3 (patch)
tree3c0f11af9dcb84dac8067a31a6979acd6dd56fbf /include/yasl/keycodes.h
parent08dc9047098d6d96791024ac7d8f5837633673ef (diff)
better public interface and doxygen
Diffstat (limited to 'include/yasl/keycodes.h')
-rw-r--r--include/yasl/keycodes.h149
1 files changed, 149 insertions, 0 deletions
diff --git a/include/yasl/keycodes.h b/include/yasl/keycodes.h
new file mode 100644
index 0000000..7586945
--- /dev/null
+++ b/include/yasl/keycodes.h
@@ -0,0 +1,149 @@
+/**
+ * @file
+ * Portable physical keyboard identities, included by yasl/yasl.h.
+ * Letter/punctuation names describe positions on a US keyboard, regardless of
+ * active layout or modifiers. Use YASL_INPUT_TEXT for text and codepoint/shifted
+ * in yasl_key_event for layout labels. These values are neither Unicode nor
+ * native scancodes; do not derive a character from a key enumerator.
+ */
+#ifndef YASL_KEYCODES_H
+#define YASL_KEYCODES_H
+
+#include <stdint.h>
+
+/** Physical keys. Unrecognized native keys report YASL_KEY_UNKNOWN. */
+enum yasl_key : uint32_t {
+ YASL_KEY_UNKNOWN = 0x000, /**< No portable identity; native_code may still identify the key. */
+ YASL_KEY_SPACE = 0x020, /**< Space. */
+ YASL_KEY_APOSTROPHE = 0x027, /**< Apostrophe. */
+ YASL_KEY_COMMA = 0x02c, /**< Comma. */
+ YASL_KEY_MINUS = 0x02d, /**< Minus. */
+ YASL_KEY_PERIOD = 0x02e, /**< Period. */
+ YASL_KEY_SLASH = 0x02f, /**< Slash. */
+ YASL_KEY_0 = 0x030, /**< Physical 0 key. */
+ YASL_KEY_1 = 0x031, /**< Physical 1 key. */
+ YASL_KEY_2 = 0x032, /**< Physical 2 key. */
+ YASL_KEY_3 = 0x033, /**< Physical 3 key. */
+ YASL_KEY_4 = 0x034, /**< Physical 4 key. */
+ YASL_KEY_5 = 0x035, /**< Physical 5 key. */
+ YASL_KEY_6 = 0x036, /**< Physical 6 key. */
+ YASL_KEY_7 = 0x037, /**< Physical 7 key. */
+ YASL_KEY_8 = 0x038, /**< Physical 8 key. */
+ YASL_KEY_9 = 0x039, /**< Physical 9 key. */
+ YASL_KEY_SEMICOLON = 0x03b, /**< Semicolon. */
+ YASL_KEY_EQUAL = 0x03d, /**< Equal. */
+ YASL_KEY_A = 0x041, /**< Physical US A position; independent of layout and modifiers. */
+ YASL_KEY_B = 0x042, /**< Physical US B position; independent of layout and modifiers. */
+ YASL_KEY_C = 0x043, /**< Physical US C position; independent of layout and modifiers. */
+ YASL_KEY_D = 0x044, /**< Physical US D position; independent of layout and modifiers. */
+ YASL_KEY_E = 0x045, /**< Physical US E position; independent of layout and modifiers. */
+ YASL_KEY_F = 0x046, /**< Physical US F position; independent of layout and modifiers. */
+ YASL_KEY_G = 0x047, /**< Physical US G position; independent of layout and modifiers. */
+ YASL_KEY_H = 0x048, /**< Physical US H position; independent of layout and modifiers. */
+ YASL_KEY_I = 0x049, /**< Physical US I position; independent of layout and modifiers. */
+ YASL_KEY_J = 0x04a, /**< Physical US J position; independent of layout and modifiers. */
+ YASL_KEY_K = 0x04b, /**< Physical US K position; independent of layout and modifiers. */
+ YASL_KEY_L = 0x04c, /**< Physical US L position; independent of layout and modifiers. */
+ YASL_KEY_M = 0x04d, /**< Physical US M position; independent of layout and modifiers. */
+ YASL_KEY_N = 0x04e, /**< Physical US N position; independent of layout and modifiers. */
+ YASL_KEY_O = 0x04f, /**< Physical US O position; independent of layout and modifiers. */
+ YASL_KEY_P = 0x050, /**< Physical US P position; independent of layout and modifiers. */
+ YASL_KEY_Q = 0x051, /**< Physical US Q position; independent of layout and modifiers. */
+ YASL_KEY_R = 0x052, /**< Physical US R position; independent of layout and modifiers. */
+ YASL_KEY_S = 0x053, /**< Physical US S position; independent of layout and modifiers. */
+ YASL_KEY_T = 0x054, /**< Physical US T position; independent of layout and modifiers. */
+ YASL_KEY_U = 0x055, /**< Physical US U position; independent of layout and modifiers. */
+ YASL_KEY_V = 0x056, /**< Physical US V position; independent of layout and modifiers. */
+ YASL_KEY_W = 0x057, /**< Physical US W position; independent of layout and modifiers. */
+ YASL_KEY_X = 0x058, /**< Physical US X position; independent of layout and modifiers. */
+ YASL_KEY_Y = 0x059, /**< Physical US Y position; independent of layout and modifiers. */
+ YASL_KEY_Z = 0x05a, /**< Physical US Z position; independent of layout and modifiers. */
+ YASL_KEY_LEFT_BRACKET = 0x05b, /**< Left Bracket. */
+ YASL_KEY_BACKSLASH = 0x05c, /**< Backslash. */
+ YASL_KEY_RIGHT_BRACKET = 0x05d, /**< Right Bracket. */
+ YASL_KEY_GRAVE = 0x060, /**< Grave. */
+ YASL_KEY_ESCAPE = 0x100, /**< Escape. */
+ YASL_KEY_ENTER = 0x101, /**< Enter. */
+ YASL_KEY_TAB = 0x102, /**< Tab. */
+ YASL_KEY_BACKSPACE = 0x103, /**< Backspace. */
+ YASL_KEY_INSERT = 0x104, /**< Insert. */
+ YASL_KEY_DELETE = 0x105, /**< Delete. */
+ YASL_KEY_RIGHT = 0x106, /**< Right. */
+ YASL_KEY_LEFT = 0x107, /**< Left. */
+ YASL_KEY_DOWN = 0x108, /**< Down. */
+ YASL_KEY_UP = 0x109, /**< Up. */
+ YASL_KEY_PAGE_UP = 0x10a, /**< Page Up. */
+ YASL_KEY_PAGE_DOWN = 0x10b, /**< Page Down. */
+ YASL_KEY_HOME = 0x10c, /**< Home. */
+ YASL_KEY_END = 0x10d, /**< End. */
+ YASL_KEY_CAPS_LOCK = 0x10e, /**< Caps Lock. */
+ YASL_KEY_SCROLL_LOCK = 0x10f, /**< Scroll Lock. */
+ YASL_KEY_NUM_LOCK = 0x110, /**< Num Lock. */
+ YASL_KEY_PRINT_SCREEN = 0x111, /**< Print Screen. */
+ YASL_KEY_PAUSE = 0x112, /**< Pause. */
+ YASL_KEY_ISO_BACKSLASH = 0x113, /**< Iso Backslash. */
+ YASL_KEY_YEN = 0x114, /**< Yen. */
+ YASL_KEY_RO = 0x115, /**< Ro. */
+ YASL_KEY_KANA = 0x116, /**< Kana. */
+ YASL_KEY_EISU = 0x117, /**< Eisu. */
+ YASL_KEY_CONVERT = 0x118, /**< Convert. */
+ YASL_KEY_NONCONVERT = 0x119, /**< Nonconvert. */
+ YASL_KEY_F1 = 0x120, /**< Function key F1. */
+ YASL_KEY_F2 = 0x121, /**< Function key F2. */
+ YASL_KEY_F3 = 0x122, /**< Function key F3. */
+ YASL_KEY_F4 = 0x123, /**< Function key F4. */
+ YASL_KEY_F5 = 0x124, /**< Function key F5. */
+ YASL_KEY_F6 = 0x125, /**< Function key F6. */
+ YASL_KEY_F7 = 0x126, /**< Function key F7. */
+ YASL_KEY_F8 = 0x127, /**< Function key F8. */
+ YASL_KEY_F9 = 0x128, /**< Function key F9. */
+ YASL_KEY_F10 = 0x129, /**< Function key F10. */
+ YASL_KEY_F11 = 0x12a, /**< Function key F11. */
+ YASL_KEY_F12 = 0x12b, /**< Function key F12. */
+ YASL_KEY_F13 = 0x12c, /**< Function key F13. */
+ YASL_KEY_F14 = 0x12d, /**< Function key F14. */
+ YASL_KEY_F15 = 0x12e, /**< Function key F15. */
+ YASL_KEY_F16 = 0x12f, /**< Function key F16. */
+ YASL_KEY_F17 = 0x130, /**< Function key F17. */
+ YASL_KEY_F18 = 0x131, /**< Function key F18. */
+ YASL_KEY_F19 = 0x132, /**< Function key F19. */
+ YASL_KEY_F20 = 0x133, /**< Function key F20. */
+ YASL_KEY_F21 = 0x134, /**< Function key F21. */
+ YASL_KEY_F22 = 0x135, /**< Function key F22. */
+ YASL_KEY_F23 = 0x136, /**< Function key F23. */
+ YASL_KEY_F24 = 0x137, /**< Function key F24. */
+ YASL_KEY_F25 = 0x138, /**< Function key F25. */
+ YASL_KEY_KP_0 = 0x140, /**< Numeric keypad 0. */
+ YASL_KEY_KP_1 = 0x141, /**< Numeric keypad 1. */
+ YASL_KEY_KP_2 = 0x142, /**< Numeric keypad 2. */
+ YASL_KEY_KP_3 = 0x143, /**< Numeric keypad 3. */
+ YASL_KEY_KP_4 = 0x144, /**< Numeric keypad 4. */
+ YASL_KEY_KP_5 = 0x145, /**< Numeric keypad 5. */
+ YASL_KEY_KP_6 = 0x146, /**< Numeric keypad 6. */
+ YASL_KEY_KP_7 = 0x147, /**< Numeric keypad 7. */
+ YASL_KEY_KP_8 = 0x148, /**< Numeric keypad 8. */
+ YASL_KEY_KP_9 = 0x149, /**< Numeric keypad 9. */
+ YASL_KEY_KP_DECIMAL = 0x14a, /**< Numeric keypad decimal. */
+ YASL_KEY_KP_DIVIDE = 0x14b, /**< Numeric keypad divide. */
+ YASL_KEY_KP_MULTIPLY = 0x14c, /**< Numeric keypad multiply. */
+ YASL_KEY_KP_SUBTRACT = 0x14d, /**< Numeric keypad subtract. */
+ YASL_KEY_KP_ADD = 0x14e, /**< Numeric keypad add. */
+ YASL_KEY_KP_ENTER = 0x14f, /**< Numeric keypad enter. */
+ YASL_KEY_KP_EQUAL = 0x150, /**< Numeric keypad equal. */
+ YASL_KEY_KP_COMMA = 0x151, /**< Numeric keypad comma. */
+ YASL_KEY_KP_CLEAR = 0x152, /**< Numeric keypad clear. */
+ YASL_KEY_LEFT_SHIFT = 0x160, /**< Left Shift. */
+ YASL_KEY_LEFT_CONTROL = 0x161, /**< Left Control. */
+ YASL_KEY_LEFT_ALT = 0x162, /**< Left Alt. */
+ YASL_KEY_LEFT_SUPER = 0x163, /**< Left Super. */
+ YASL_KEY_RIGHT_SHIFT = 0x164, /**< Right Shift. */
+ YASL_KEY_RIGHT_CONTROL = 0x165, /**< Right Control. */
+ YASL_KEY_RIGHT_ALT = 0x166, /**< Right Alt. */
+ YASL_KEY_RIGHT_SUPER = 0x167, /**< Right Super. */
+ YASL_KEY_MENU = 0x168, /**< Menu. */
+ YASL_KEY_VOLUME_UP = 0x169, /**< Volume Up. */
+ YASL_KEY_VOLUME_DOWN = 0x16a, /**< Volume Down. */
+ YASL_KEY_MUTE = 0x16b, /**< Mute. */
+};
+
+#endif /* YASL_KEYCODES_H */