diff options
Diffstat (limited to 'hid/lib/drivers-stm32/usb/keymap.h')
-rw-r--r-- | hid/lib/drivers-stm32/usb/keymap.h | 220 |
1 files changed, 109 insertions, 111 deletions
diff --git a/hid/lib/drivers-stm32/usb/keymap.h b/hid/lib/drivers-stm32/usb/keymap.h index 9f5015b3..a63598cf 100644 --- a/hid/lib/drivers-stm32/usb/keymap.h +++ b/hid/lib/drivers-stm32/usb/keymap.h @@ -22,118 +22,116 @@ #pragma once -#include "keycode.h" - -KeyboardKeycode keymapUsb(uint8_t code) { +uint8_t keymapUsb(uint8_t code) { switch (code) { - case 1: return KEY_A; - case 2: return KEY_B; - case 3: return KEY_C; - case 4: return KEY_D; - case 5: return KEY_E; - case 6: return KEY_F; - case 7: return KEY_G; - case 8: return KEY_H; - case 9: return KEY_I; - case 10: return KEY_J; - case 11: return KEY_K; - case 12: return KEY_L; - case 13: return KEY_M; - case 14: return KEY_N; - case 15: return KEY_O; - case 16: return KEY_P; - case 17: return KEY_Q; - case 18: return KEY_R; - case 19: return KEY_S; - case 20: return KEY_T; - case 21: return KEY_U; - case 22: return KEY_V; - case 23: return KEY_W; - case 24: return KEY_X; - case 25: return KEY_Y; - case 26: return KEY_Z; - case 27: return KEY_1; - case 28: return KEY_2; - case 29: return KEY_3; - case 30: return KEY_4; - case 31: return KEY_5; - case 32: return KEY_6; - case 33: return KEY_7; - case 34: return KEY_8; - case 35: return KEY_9; - case 36: return KEY_0; - case 37: return KEY_ENTER; - case 38: return KEY_ESC; - case 39: return KEY_BACKSPACE; - case 40: return KEY_TAB; - case 41: return KEY_SPACE; - case 42: return KEY_MINUS; - case 43: return KEY_EQUAL; - case 44: return KEY_LEFT_BRACE; - case 45: return KEY_RIGHT_BRACE; - case 46: return KEY_BACKSLASH; - case 47: return KEY_SEMICOLON; - case 48: return KEY_QUOTE; - case 49: return KEY_TILDE; - case 50: return KEY_COMMA; - case 51: return KEY_PERIOD; - case 52: return KEY_SLASH; - case 53: return KEY_CAPS_LOCK; - case 54: return KEY_F1; - case 55: return KEY_F2; - case 56: return KEY_F3; - case 57: return KEY_F4; - case 58: return KEY_F5; - case 59: return KEY_F6; - case 60: return KEY_F7; - case 61: return KEY_F8; - case 62: return KEY_F9; - case 63: return KEY_F10; - case 64: return KEY_F11; - case 65: return KEY_F12; - case 66: return KEY_PRINT; - case 67: return KEY_INSERT; - case 68: return KEY_HOME; - case 69: return KEY_PAGE_UP; - case 70: return KEY_DELETE; - case 71: return KEY_END; - case 72: return KEY_PAGE_DOWN; - case 73: return KEY_RIGHT_ARROW; - case 74: return KEY_LEFT_ARROW; - case 75: return KEY_DOWN_ARROW; - case 76: return KEY_UP_ARROW; - case 77: return KEY_LEFT_CTRL; - case 78: return KEY_LEFT_SHIFT; - case 79: return KEY_LEFT_ALT; - case 80: return KEY_LEFT_GUI; - case 81: return KEY_RIGHT_CTRL; - case 82: return KEY_RIGHT_SHIFT; - case 83: return KEY_RIGHT_ALT; - case 84: return KEY_RIGHT_GUI; - case 85: return KEY_PAUSE; - case 86: return KEY_SCROLL_LOCK; - case 87: return KEY_NUM_LOCK; - case 88: return KEY_MENU; - case 89: return KEYPAD_DIVIDE; - case 90: return KEYPAD_MULTIPLY; - case 91: return KEYPAD_SUBTRACT; - case 92: return KEYPAD_ADD; - case 93: return KEYPAD_ENTER; - case 94: return KEYPAD_1; - case 95: return KEYPAD_2; - case 96: return KEYPAD_3; - case 97: return KEYPAD_4; - case 98: return KEYPAD_5; - case 99: return KEYPAD_6; - case 100: return KEYPAD_7; - case 101: return KEYPAD_8; - case 102: return KEYPAD_9; - case 103: return KEYPAD_0; - case 104: return KEYPAD_DOT; - case 105: return KEY_POWER; - case 106: return KEY_NON_US; - case 107: return KEY_INTERNATIONAL3; - default: return KEY_ERROR_UNDEFINED; + case 1: return 4; // KeyA + case 2: return 5; // KeyB + case 3: return 6; // KeyC + case 4: return 7; // KeyD + case 5: return 8; // KeyE + case 6: return 9; // KeyF + case 7: return 10; // KeyG + case 8: return 11; // KeyH + case 9: return 12; // KeyI + case 10: return 13; // KeyJ + case 11: return 14; // KeyK + case 12: return 15; // KeyL + case 13: return 16; // KeyM + case 14: return 17; // KeyN + case 15: return 18; // KeyO + case 16: return 19; // KeyP + case 17: return 20; // KeyQ + case 18: return 21; // KeyR + case 19: return 22; // KeyS + case 20: return 23; // KeyT + case 21: return 24; // KeyU + case 22: return 25; // KeyV + case 23: return 26; // KeyW + case 24: return 27; // KeyX + case 25: return 28; // KeyY + case 26: return 29; // KeyZ + case 27: return 30; // Digit1 + case 28: return 31; // Digit2 + case 29: return 32; // Digit3 + case 30: return 33; // Digit4 + case 31: return 34; // Digit5 + case 32: return 35; // Digit6 + case 33: return 36; // Digit7 + case 34: return 37; // Digit8 + case 35: return 38; // Digit9 + case 36: return 39; // Digit0 + case 37: return 40; // Enter + case 38: return 41; // Escape + case 39: return 42; // Backspace + case 40: return 43; // Tab + case 41: return 44; // Space + case 42: return 45; // Minus + case 43: return 46; // Equal + case 44: return 47; // BracketLeft + case 45: return 48; // BracketRight + case 46: return 49; // Backslash + case 47: return 51; // Semicolon + case 48: return 52; // Quote + case 49: return 53; // Backquote + case 50: return 54; // Comma + case 51: return 55; // Period + case 52: return 56; // Slash + case 53: return 57; // CapsLock + case 54: return 58; // F1 + case 55: return 59; // F2 + case 56: return 60; // F3 + case 57: return 61; // F4 + case 58: return 62; // F5 + case 59: return 63; // F6 + case 60: return 64; // F7 + case 61: return 65; // F8 + case 62: return 66; // F9 + case 63: return 67; // F10 + case 64: return 68; // F11 + case 65: return 69; // F12 + case 66: return 70; // PrintScreen + case 67: return 73; // Insert + case 68: return 74; // Home + case 69: return 75; // PageUp + case 70: return 76; // Delete + case 71: return 77; // End + case 72: return 78; // PageDown + case 73: return 79; // ArrowRight + case 74: return 80; // ArrowLeft + case 75: return 81; // ArrowDown + case 76: return 82; // ArrowUp + case 77: return 224; // ControlLeft + case 78: return 225; // ShiftLeft + case 79: return 226; // AltLeft + case 80: return 227; // MetaLeft + case 81: return 228; // ControlRight + case 82: return 229; // ShiftRight + case 83: return 230; // AltRight + case 84: return 231; // MetaRight + case 85: return 72; // Pause + case 86: return 71; // ScrollLock + case 87: return 83; // NumLock + case 88: return 101; // ContextMenu + case 89: return 84; // NumpadDivide + case 90: return 85; // NumpadMultiply + case 91: return 86; // NumpadSubtract + case 92: return 87; // NumpadAdd + case 93: return 88; // NumpadEnter + case 94: return 89; // Numpad1 + case 95: return 90; // Numpad2 + case 96: return 91; // Numpad3 + case 97: return 92; // Numpad4 + case 98: return 93; // Numpad5 + case 99: return 94; // Numpad6 + case 100: return 95; // Numpad7 + case 101: return 96; // Numpad8 + case 102: return 97; // Numpad9 + case 103: return 98; // Numpad0 + case 104: return 99; // NumpadDecimal + case 105: return 102; // Power + case 106: return 100; // IntlBackslash + case 107: return 137; // IntlYen + default: return 0; } } |