diff --git a/include/grub/keyboard_layouts.h b/include/grub/keyboard_layouts.h index dd6631a51..24d4880af 100644 --- a/include/grub/keyboard_layouts.h +++ b/include/grub/keyboard_layouts.h @@ -35,15 +35,106 @@ struct grub_keyboard_layout typedef enum grub_keyboard_key { + GRUB_KEYBOARD_KEY_A = 0x04, + GRUB_KEYBOARD_KEY_B = 0x05, + GRUB_KEYBOARD_KEY_C = 0x06, + GRUB_KEYBOARD_KEY_D = 0x07, + GRUB_KEYBOARD_KEY_E = 0x08, + GRUB_KEYBOARD_KEY_F = 0x09, + GRUB_KEYBOARD_KEY_G = 0x0a, + GRUB_KEYBOARD_KEY_H = 0x0b, + GRUB_KEYBOARD_KEY_I = 0x0c, + GRUB_KEYBOARD_KEY_J = 0x0d, + GRUB_KEYBOARD_KEY_K = 0x0e, + GRUB_KEYBOARD_KEY_L = 0x0f, + GRUB_KEYBOARD_KEY_M = 0x10, + GRUB_KEYBOARD_KEY_N = 0x11, + GRUB_KEYBOARD_KEY_O = 0x12, + GRUB_KEYBOARD_KEY_P = 0x13, + GRUB_KEYBOARD_KEY_Q = 0x14, + GRUB_KEYBOARD_KEY_R = 0x15, + GRUB_KEYBOARD_KEY_S = 0x16, + GRUB_KEYBOARD_KEY_T = 0x17, + GRUB_KEYBOARD_KEY_U = 0x18, + GRUB_KEYBOARD_KEY_V = 0x19, + GRUB_KEYBOARD_KEY_W = 0x1a, + GRUB_KEYBOARD_KEY_X = 0x1b, + GRUB_KEYBOARD_KEY_Y = 0x1c, + GRUB_KEYBOARD_KEY_Z = 0x1d, + GRUB_KEYBOARD_KEY_1 = 0x1e, + GRUB_KEYBOARD_KEY_2 = 0x1f, + GRUB_KEYBOARD_KEY_3 = 0x20, + GRUB_KEYBOARD_KEY_4 = 0x21, + GRUB_KEYBOARD_KEY_5 = 0x22, + GRUB_KEYBOARD_KEY_6 = 0x23, + GRUB_KEYBOARD_KEY_7 = 0x24, + GRUB_KEYBOARD_KEY_8 = 0x25, + GRUB_KEYBOARD_KEY_9 = 0x26, + GRUB_KEYBOARD_KEY_0 = 0x27, + GRUB_KEYBOARD_KEY_ENTER = 0x28, + GRUB_KEYBOARD_KEY_ESCAPE = 0x29, + GRUB_KEYBOARD_KEY_BACKSPACE = 0x2a, + GRUB_KEYBOARD_KEY_TAB = 0x2b, + GRUB_KEYBOARD_KEY_SPACE = 0x2c, + GRUB_KEYBOARD_KEY_DASH = 0x2d, + GRUB_KEYBOARD_KEY_EQUAL = 0x2e, + GRUB_KEYBOARD_KEY_LBRACKET = 0x2f, + GRUB_KEYBOARD_KEY_RBRACKET = 0x30, + GRUB_KEYBOARD_KEY_BACKSLASH = 0x32, + GRUB_KEYBOARD_KEY_SEMICOLON = 0x33, + GRUB_KEYBOARD_KEY_DQUOTE = 0x34, + GRUB_KEYBOARD_KEY_RQUOTE = 0x35, + GRUB_KEYBOARD_KEY_COMMA = 0x36, + GRUB_KEYBOARD_KEY_DOT = 0x37, + GRUB_KEYBOARD_KEY_SLASH = 0x38, GRUB_KEYBOARD_KEY_CAPS_LOCK = 0x39, + GRUB_KEYBOARD_KEY_F1 = 0x3a, + GRUB_KEYBOARD_KEY_F2 = 0x3b, + GRUB_KEYBOARD_KEY_F3 = 0x3c, + GRUB_KEYBOARD_KEY_F4 = 0x3d, + GRUB_KEYBOARD_KEY_F5 = 0x3e, + GRUB_KEYBOARD_KEY_F6 = 0x3f, + GRUB_KEYBOARD_KEY_F7 = 0x40, + GRUB_KEYBOARD_KEY_F8 = 0x41, + GRUB_KEYBOARD_KEY_F9 = 0x42, + GRUB_KEYBOARD_KEY_F10 = 0x43, + GRUB_KEYBOARD_KEY_F11 = 0x44, + GRUB_KEYBOARD_KEY_F12 = 0x45, GRUB_KEYBOARD_KEY_SCROLL_LOCK = 0x47, - GRUB_KEYBOARD_KEY_NUM_LOCK = 0x53, - GRUB_KEYBOARD_KEY_LEFT_CTRL = 0xe0, + GRUB_KEYBOARD_KEY_INSERT = 0x49, + GRUB_KEYBOARD_KEY_HOME = 0x4a, + GRUB_KEYBOARD_KEY_PPAGE = 0x4b, + GRUB_KEYBOARD_KEY_DELETE = 0x4c, + GRUB_KEYBOARD_KEY_END = 0x4d, + GRUB_KEYBOARD_KEY_NPAGE = 0x4e, + GRUB_KEYBOARD_KEY_RIGHT = 0x4f, + GRUB_KEYBOARD_KEY_LEFT = 0x50, + GRUB_KEYBOARD_KEY_DOWN = 0x51, + GRUB_KEYBOARD_KEY_UP = 0x52, + GRUB_KEYBOARD_KEY_NUM_LOCK = 0x53, + GRUB_KEYBOARD_KEY_NUMSLASH = 0x54, + GRUB_KEYBOARD_KEY_NUMMUL = 0x55, + GRUB_KEYBOARD_KEY_NUMMINUS = 0x56, + GRUB_KEYBOARD_KEY_NUMPLUS = 0x57, + GRUB_KEYBOARD_KEY_NUMENTER = 0x58, + GRUB_KEYBOARD_KEY_NUM1 = 0x59, + GRUB_KEYBOARD_KEY_NUM2 = 0x5a, + GRUB_KEYBOARD_KEY_NUM3 = 0x5b, + GRUB_KEYBOARD_KEY_NUM4 = 0x5c, + GRUB_KEYBOARD_KEY_NUM5 = 0x5d, + GRUB_KEYBOARD_KEY_NUM6 = 0x5e, + GRUB_KEYBOARD_KEY_NUM7 = 0x5f, + GRUB_KEYBOARD_KEY_NUM8 = 0x60, + GRUB_KEYBOARD_KEY_NUM9 = 0x61, + GRUB_KEYBOARD_KEY_NUM0 = 0x62, + GRUB_KEYBOARD_KEY_NUMDOT = 0x63, + GRUB_KEYBOARD_KEY_102ND = 0x64, + GRUB_KEYBOARD_KEY_LEFT_CTRL = 0xe0, GRUB_KEYBOARD_KEY_LEFT_SHIFT = 0xe1, - GRUB_KEYBOARD_KEY_LEFT_ALT = 0xe2, + GRUB_KEYBOARD_KEY_LEFT_ALT = 0xe2, GRUB_KEYBOARD_KEY_RIGHT_CTRL = 0xe4, GRUB_KEYBOARD_KEY_RIGHT_SHIFT = 0xe5, - GRUB_KEYBOARD_KEY_RIGHT_ALT = 0xe6, + GRUB_KEYBOARD_KEY_RIGHT_ALT = 0xe6, } grub_keyboard_key_t; unsigned EXPORT_FUNC(grub_term_map_key) (grub_keyboard_key_t code, int status); diff --git a/term/at_keyboard.c b/term/at_keyboard.c index 00c6cef83..c515a3971 100644 --- a/term/at_keyboard.c +++ b/term/at_keyboard.c @@ -41,60 +41,60 @@ static grub_uint8_t current_set; static const grub_uint8_t set1_mapping[128] = { - /* 0x00 */ 0x00 /* Unused */, 0x29 /* Escape */, - /* 0x02 */ 0x1e /* 1 */, 0x1f /* 2 */, - /* 0x04 */ 0x20 /* 3 */, 0x21 /* 4 */, - /* 0x06 */ 0x22 /* 5 */, 0x23 /* 6 */, - /* 0x08 */ 0x24 /* 7 */, 0x25 /* 8 */, - /* 0x0a */ 0x26 /* 9 */, 0x27 /* 0 */, - /* 0x0c */ 0x2d /* - */, 0x2e /* = */, - /* 0x0e */ 0x2a /* \b */, 0x2b /* \t */, - /* 0x10 */ 0x14 /* q */, 0x1a /* w */, - /* 0x12 */ 0x08 /* e */, 0x15 /* r */, - /* 0x14 */ 0x17 /* t */, 0x1c /* y */, - /* 0x16 */ 0x18 /* u */, 0x0c /* i */, - /* 0x18 */ 0x12 /* o */, 0x13 /* p */, - /* 0x1a */ 0x2f /* [ */, 0x30 /* ] */, - /* 0x1c */ 0x28 /* Enter */, 0xe0 /* Left CTRL */, - /* 0x1e */ 0x04 /* a */, 0x16 /* s */, - /* 0x20 */ 0x07 /* d */, 0x09 /* f */, - /* 0x22 */ 0x0a /* g */, 0x0b /* h */, - /* 0x24 */ 0x0d /* j */, 0x0e /* k */, - /* 0x26 */ 0x0f /* l */, 0x33 /* ; */, - /* 0x28 */ 0x34 /* " */, 0x35 /* ` */, - /* 0x2a */ 0xe1 /* Left Shift */, 0x32 /* \ */, - /* 0x2c */ 0x1d /* z */, 0x1b /* x */, - /* 0x2e */ 0x06 /* c */, 0x19 /* v */, - /* 0x30 */ 0x05 /* b */, 0x11 /* n */, - /* 0x32 */ 0x10 /* m */, 0x36 /* , */, - /* 0x34 */ 0x37 /* . */, 0x38 /* / */, - /* 0x36 */ 0xe5 /* Right Shift */, 0x55 /* Num * */, - /* 0x38 */ 0xe2 /* Left ALT */, 0x2c /* Space */, - /* 0x3a */ 0x39 /* Caps Lock */, 0x3a /* F1 */, - /* 0x3c */ 0x3b /* F2 */, 0x3c /* F3 */, - /* 0x3e */ 0x3d /* F4 */, 0x3e /* F5 */, - /* 0x40 */ 0x3f /* F6 */, 0x40 /* F7 */, - /* 0x42 */ 0x41 /* F8 */, 0x42 /* F9 */, - /* 0x44 */ 0x43 /* F10 */, 0x53 /* NumLock */, - /* 0x46 */ 0x47 /* Scroll Lock */, 0x5f /* Num 7 */, - /* 0x48 */ 0x60 /* Num 8 */, 0x61 /* Num 9 */, - /* 0x4a */ 0x56 /* Num - */, 0x5c /* Num 4 */, - /* 0x4c */ 0x5d /* Num 5 */, 0x5e /* Num 6 */, - /* 0x4e */ 0x57 /* Num + */, 0x59 /* Num 1 */, - /* 0x50 */ 0x5a /* Num 2 */, 0x5b /* Num 3 */, - /* 0x52 */ 0x62 /* Num 0 */, 0x63 /* Num . */, - /* 0x54 */ 0x00, 0x00, - /* 0x56 */ 0x64 /* 102nd key. */, 0x44 /* F11 */, - /* 0x58 */ 0x45 /* F12 */, 0x00, - /* 0x5a */ 0x00, 0x00, - /* 0x5c */ 0x00, 0x00, - /* 0x5e */ 0x00, 0x00, - /* 0x60 */ 0x00, 0x00, - /* 0x62 */ 0x00, 0x00, + /* 0x00 */ 0 /* Unused */, GRUB_KEYBOARD_KEY_ESCAPE, + /* 0x02 */ GRUB_KEYBOARD_KEY_1, GRUB_KEYBOARD_KEY_2, + /* 0x04 */ GRUB_KEYBOARD_KEY_3, GRUB_KEYBOARD_KEY_4, + /* 0x06 */ GRUB_KEYBOARD_KEY_5, GRUB_KEYBOARD_KEY_6, + /* 0x08 */ GRUB_KEYBOARD_KEY_7, GRUB_KEYBOARD_KEY_8, + /* 0x0a */ GRUB_KEYBOARD_KEY_9, GRUB_KEYBOARD_KEY_0, + /* 0x0c */ GRUB_KEYBOARD_KEY_DASH, GRUB_KEYBOARD_KEY_EQUAL, + /* 0x0e */ GRUB_KEYBOARD_KEY_BACKSPACE, GRUB_KEYBOARD_KEY_TAB, + /* 0x10 */ GRUB_KEYBOARD_KEY_Q, GRUB_KEYBOARD_KEY_W, + /* 0x12 */ GRUB_KEYBOARD_KEY_E, GRUB_KEYBOARD_KEY_R, + /* 0x14 */ GRUB_KEYBOARD_KEY_T, GRUB_KEYBOARD_KEY_Y, + /* 0x16 */ GRUB_KEYBOARD_KEY_U, GRUB_KEYBOARD_KEY_I, + /* 0x18 */ GRUB_KEYBOARD_KEY_O, GRUB_KEYBOARD_KEY_P, + /* 0x1a */ GRUB_KEYBOARD_KEY_LBRACKET, GRUB_KEYBOARD_KEY_RBRACKET, + /* 0x1c */ GRUB_KEYBOARD_KEY_ENTER, GRUB_KEYBOARD_KEY_LEFT_CTRL, + /* 0x1e */ GRUB_KEYBOARD_KEY_A, GRUB_KEYBOARD_KEY_S, + /* 0x20 */ GRUB_KEYBOARD_KEY_D, GRUB_KEYBOARD_KEY_F, + /* 0x22 */ GRUB_KEYBOARD_KEY_G, GRUB_KEYBOARD_KEY_H, + /* 0x24 */ GRUB_KEYBOARD_KEY_J, GRUB_KEYBOARD_KEY_K, + /* 0x26 */ GRUB_KEYBOARD_KEY_L, GRUB_KEYBOARD_KEY_SEMICOLON, + /* 0x28 */ GRUB_KEYBOARD_KEY_DQUOTE, GRUB_KEYBOARD_KEY_RQUOTE, + /* 0x2a */ GRUB_KEYBOARD_KEY_LEFT_SHIFT, GRUB_KEYBOARD_KEY_BACKSLASH, + /* 0x2c */ GRUB_KEYBOARD_KEY_Z, GRUB_KEYBOARD_KEY_X, + /* 0x2e */ GRUB_KEYBOARD_KEY_C, GRUB_KEYBOARD_KEY_V, + /* 0x30 */ GRUB_KEYBOARD_KEY_B, GRUB_KEYBOARD_KEY_N, + /* 0x32 */ GRUB_KEYBOARD_KEY_M, GRUB_KEYBOARD_KEY_COMMA, + /* 0x34 */ GRUB_KEYBOARD_KEY_DOT, GRUB_KEYBOARD_KEY_SLASH, + /* 0x36 */ GRUB_KEYBOARD_KEY_RIGHT_SHIFT, GRUB_KEYBOARD_KEY_NUMMUL, + /* 0x38 */ GRUB_KEYBOARD_KEY_LEFT_ALT, GRUB_KEYBOARD_KEY_SPACE, + /* 0x3a */ GRUB_KEYBOARD_KEY_CAPS_LOCK, GRUB_KEYBOARD_KEY_F1, + /* 0x3c */ GRUB_KEYBOARD_KEY_F2, GRUB_KEYBOARD_KEY_F3, + /* 0x3e */ GRUB_KEYBOARD_KEY_F4, GRUB_KEYBOARD_KEY_F5, + /* 0x40 */ GRUB_KEYBOARD_KEY_F6, GRUB_KEYBOARD_KEY_F7, + /* 0x42 */ GRUB_KEYBOARD_KEY_F8, GRUB_KEYBOARD_KEY_F9, + /* 0x44 */ GRUB_KEYBOARD_KEY_F10, GRUB_KEYBOARD_KEY_NUM_LOCK, + /* 0x46 */ GRUB_KEYBOARD_KEY_SCROLL_LOCK, GRUB_KEYBOARD_KEY_NUM7, + /* 0x48 */ GRUB_KEYBOARD_KEY_NUM8, GRUB_KEYBOARD_KEY_NUM9, + /* 0x4a */ GRUB_KEYBOARD_KEY_NUMMINUS, GRUB_KEYBOARD_KEY_NUM4, + /* 0x4c */ GRUB_KEYBOARD_KEY_NUM5, GRUB_KEYBOARD_KEY_NUM6, + /* 0x4e */ GRUB_KEYBOARD_KEY_NUMPLUS, GRUB_KEYBOARD_KEY_NUM1, + /* 0x50 */ GRUB_KEYBOARD_KEY_NUM2, GRUB_KEYBOARD_KEY_NUM3, + /* 0x52 */ GRUB_KEYBOARD_KEY_NUMDOT, GRUB_KEYBOARD_KEY_NUMDOT, + /* 0x54 */ 0, 0, + /* 0x56 */ GRUB_KEYBOARD_KEY_102ND, GRUB_KEYBOARD_KEY_F11, + /* 0x58 */ GRUB_KEYBOARD_KEY_F12, 0, + /* 0x5a */ 0, 0, + /* 0x5c */ 0, 0, + /* 0x5e */ 0, 0, + /* 0x60 */ 0, 0, + /* 0x62 */ 0, 0, /* OLPC keys. Just mapped to normal keys. */ - /* 0x64 */ 0x00, 0x52 /* Up */, - /* 0x66 */ 0x51 /* Down */, 0x50 /* Left */, - /* 0x68 */ 0x4f /* Right */ + /* 0x64 */ 0, GRUB_KEYBOARD_KEY_UP, + /* 0x66 */ GRUB_KEYBOARD_KEY_DOWN, GRUB_KEYBOARD_KEY_LEFT, + /* 0x68 */ GRUB_KEYBOARD_KEY_RIGHT }; static const struct @@ -102,57 +102,90 @@ static const struct grub_uint8_t from, to; } set1_e0_mapping[] = { - {0x1c, 0x58 /* Num \n */}, - {0x1d, 0xe4 /* Right CTRL */}, - {0x35, 0x54 /* Num / */ }, - {0x38, 0xe6 /* Right ALT */}, - {0x47, 0x4a /* Home */ }, - {0x48, 0x52 /* Up */ }, - {0x49, 0x4e /* NPage */ }, - {0x4b, 0x50 /* Left */ }, - {0x4d, 0x4f /* Right */ }, - {0x4f, 0x4d /* End */ }, - {0x50, 0x51 /* Down */ }, - {0x51, 0x4b /* PPage */ }, - {0x52, 0x49 /* Insert */}, - {0x53, 0x4c /* DC */ }, + {0x1c, GRUB_KEYBOARD_KEY_NUMENTER}, + {0x1d, GRUB_KEYBOARD_KEY_RIGHT_CTRL}, + {0x35, GRUB_KEYBOARD_KEY_NUMSLASH }, + {0x38, GRUB_KEYBOARD_KEY_RIGHT_ALT}, + {0x47, GRUB_KEYBOARD_KEY_HOME}, + {0x48, GRUB_KEYBOARD_KEY_UP}, + {0x49, GRUB_KEYBOARD_KEY_NPAGE}, + {0x4b, GRUB_KEYBOARD_KEY_LEFT}, + {0x4d, GRUB_KEYBOARD_KEY_RIGHT}, + {0x4f, GRUB_KEYBOARD_KEY_END}, + {0x50, GRUB_KEYBOARD_KEY_DOWN}, + {0x51, GRUB_KEYBOARD_KEY_PPAGE}, + {0x52, GRUB_KEYBOARD_KEY_INSERT}, + {0x53, GRUB_KEYBOARD_KEY_DELETE}, }; static const grub_uint8_t set2_mapping[256] = { - /* 0x00 */ 0x00, 0x42 /* F9 */, 0x00, 0x3e /* F5 */, - /* 0x04 */ 0x3c /* F3 */, 0x3a /* F1 */, 0x3b /* F2 */, 0x45 /* F12 */, - /* 0x08 */ 0x00, 0x43 /* F10 */, 0x41 /* F8 */, 0x3f /* F6 */, - /* 0x0c */ 0x3d /* F4 */, 0x2b /* \t */, 0x35 /* ` */, 0x00, - /* 0x10 */ 0x00, GRUB_KEYBOARD_KEY_LEFT_ALT, GRUB_KEYBOARD_KEY_LEFT_SHIFT, 0x00, - /* 0x14 */ GRUB_KEYBOARD_KEY_LEFT_CTRL, 0x14 /* q */, 0x1e /* 1 */, 0x00, - /* 0x18 */ 0x00, 0x00, 0x1d /* s */, 0x16 /* s */, - /* 0x1c */ 0x04 /* a */, 0x1a /* w */, 0x1f /* 2 */, 0x00, - /* 0x20 */ 0x00, 0x06 /* c */, 0x1b /* x */, 0x07 /* d */, - /* 0x24 */ 0x08 /* e */, 0x21 /* 4 */, 0x20 /* 3 */, 0x00, - /* 0x28 */ 0x00, 0x2c /* Space */, 0x19 /* v */, 0x09 /* f */, - /* 0x2c */ 0x17 /* t */, 0x15 /* r */, 0x22 /* 5 */, 0x00, - /* 0x30 */ 0x00, 0x11 /* n */, 0x05 /* b */, 0x0b /* h */, - /* 0x34 */ 0x0a /* g */, 0x1c /* y */, 0x23 /* 6 */, 0x00, - /* 0x38 */ 0x00, 0x00, 0x10 /* m */, 0x0d /* j */, - /* 0x3c */ 0x18 /* u */, 0x24 /* 7 */, 0x25 /* 8 */, 0x00, - /* 0x40 */ 0x00, 0x37 /* . */, 0x0e /* k */, 0x0c /* i */, - /* 0x44 */ 0x12 /* o */, 0x27 /* 0 */, 0x26 /* 9 */, 0x00, - /* 0x48 */ 0x00, 0x36 /* , */, 0x38 /* / */, 0x0f /* l */, - /* 0x4c */ 0x33 /* ; */, 0x13 /* p */, 0x2d /* - */, 0x00, - /* 0x50 */ 0x00, 0x00, 0x34 /* ' */, 0x00, - /* 0x54 */ 0x2f /* [ */, 0x2e /* = */, 0x00, 0x00, - /* 0x58 */ GRUB_KEYBOARD_KEY_CAPS_LOCK, GRUB_KEYBOARD_KEY_RIGHT_SHIFT, 0x28 /* \n */,0x30 /* ] */, - /* 0x5c */ 0x00, 0x32 /* \ */, 0x00, 0x00, - /* 0x60 */ 0x00, 0x64 /* 102nd key. */, 0x00, 0x00, - /* 0x64 */ 0x00, 0x00, 0x2a /* \b */, 0x00, - /* 0x68 */ 0x00, 0x59 /* Num 1 */, 0x00, 0x5c /* Num 4 */, - /* 0x6c */ 0x5f /* Num 7 */, 0x00, 0x00, 0x00, - /* 0x70 */ 0x62 /* Num 0 */, 0x63 /* Num 0 */, 0x5a /* Num 2 */, 0x5d /* Num 5 */, - /* 0x74 */ 0x5e /* Num 6 */, 0x60 /* Num 8 */, 0x29 /* \e */, 0x53 /* NumLock */, - /* 0x78 */ 0x44 /* F11 */, 0x57 /* Num + */, 0x5b /* Num 3 */, 0x56 /* Num - */, - /* 0x7c */ 0x55 /* Num * */, 0x61 /* Num 9 */, 0x47 /* ScrollLock */, 0x00, - /* 0x80 */ 0x00, 0x00, 0x00, 0x40 /* F7 */, + /* 0x00 */ 0, GRUB_KEYBOARD_KEY_F9, + /* 0x02 */ 0, GRUB_KEYBOARD_KEY_F5, + /* 0x04 */ GRUB_KEYBOARD_KEY_F3, GRUB_KEYBOARD_KEY_F1, + /* 0x06 */ GRUB_KEYBOARD_KEY_F2, GRUB_KEYBOARD_KEY_F12, + /* 0x08 */ 0, GRUB_KEYBOARD_KEY_F10, + /* 0x0a */ GRUB_KEYBOARD_KEY_F8, GRUB_KEYBOARD_KEY_F6, + /* 0x0c */ GRUB_KEYBOARD_KEY_F4, GRUB_KEYBOARD_KEY_TAB, + /* 0x0e */ GRUB_KEYBOARD_KEY_RQUOTE, 0, + /* 0x10 */ 0, GRUB_KEYBOARD_KEY_LEFT_ALT, + /* 0x12 */ GRUB_KEYBOARD_KEY_LEFT_SHIFT, 0, + /* 0x14 */ GRUB_KEYBOARD_KEY_LEFT_CTRL, GRUB_KEYBOARD_KEY_Q, + /* 0x16 */ GRUB_KEYBOARD_KEY_1, 0, + /* 0x18 */ 0, 0, + /* 0x1a */ GRUB_KEYBOARD_KEY_Z, GRUB_KEYBOARD_KEY_S, + /* 0x1c */ GRUB_KEYBOARD_KEY_A, GRUB_KEYBOARD_KEY_W, + /* 0x1e */ GRUB_KEYBOARD_KEY_2, 0, + /* 0x20 */ 0, GRUB_KEYBOARD_KEY_C, + /* 0x22 */ GRUB_KEYBOARD_KEY_X, GRUB_KEYBOARD_KEY_D, + /* 0x24 */ GRUB_KEYBOARD_KEY_E, GRUB_KEYBOARD_KEY_4, + /* 0x26 */ GRUB_KEYBOARD_KEY_3, 0, + /* 0x28 */ 0, GRUB_KEYBOARD_KEY_SPACE, + /* 0x2a */ GRUB_KEYBOARD_KEY_V, GRUB_KEYBOARD_KEY_F, + /* 0x2c */ GRUB_KEYBOARD_KEY_T, GRUB_KEYBOARD_KEY_R, + /* 0x2e */ GRUB_KEYBOARD_KEY_5, 0, + /* 0x30 */ 0, GRUB_KEYBOARD_KEY_N, + /* 0x32 */ GRUB_KEYBOARD_KEY_B, GRUB_KEYBOARD_KEY_H, + /* 0x34 */ GRUB_KEYBOARD_KEY_G, GRUB_KEYBOARD_KEY_Y, + /* 0x36 */ GRUB_KEYBOARD_KEY_6, 0, + /* 0x38 */ 0, 0, + /* 0x3a */ GRUB_KEYBOARD_KEY_M, GRUB_KEYBOARD_KEY_J, + /* 0x3c */ GRUB_KEYBOARD_KEY_U, GRUB_KEYBOARD_KEY_7, + /* 0x3e */ GRUB_KEYBOARD_KEY_8, 0, + /* 0x40 */ 0, GRUB_KEYBOARD_KEY_DOT, + /* 0x42 */ GRUB_KEYBOARD_KEY_K, GRUB_KEYBOARD_KEY_I, + /* 0x44 */ GRUB_KEYBOARD_KEY_O, GRUB_KEYBOARD_KEY_0, + /* 0x46 */ GRUB_KEYBOARD_KEY_9, 0, + /* 0x48 */ 0, GRUB_KEYBOARD_KEY_COMMA, + /* 0x4a */ GRUB_KEYBOARD_KEY_SLASH, GRUB_KEYBOARD_KEY_L, + /* 0x4c */ GRUB_KEYBOARD_KEY_SEMICOLON, GRUB_KEYBOARD_KEY_P, + /* 0x4e */ GRUB_KEYBOARD_KEY_DASH, 0, + /* 0x50 */ 0, 0, + /* 0x52 */ GRUB_KEYBOARD_KEY_DQUOTE, 0, + /* 0x54 */ GRUB_KEYBOARD_KEY_LBRACKET, GRUB_KEYBOARD_KEY_EQUAL, + /* 0x56 */ 0, 0, + /* 0x58 */ GRUB_KEYBOARD_KEY_CAPS_LOCK, GRUB_KEYBOARD_KEY_RIGHT_SHIFT, + /* 0x5a */ GRUB_KEYBOARD_KEY_ENTER, GRUB_KEYBOARD_KEY_RBRACKET, + /* 0x5c */ 0, GRUB_KEYBOARD_KEY_BACKSLASH, + /* 0x5e */ 0, 0, + /* 0x60 */ 0, GRUB_KEYBOARD_KEY_102ND, + /* 0x62 */ 0, 0, + /* 0x64 */ 0, 0, + /* 0x66 */ GRUB_KEYBOARD_KEY_BACKSPACE, 0, + /* 0x68 */ 0, GRUB_KEYBOARD_KEY_NUM1, + /* 0x6a */ 0, GRUB_KEYBOARD_KEY_NUM4, + /* 0x6c */ GRUB_KEYBOARD_KEY_NUM7, 0, + /* 0x6e */ 0, 0, + /* 0x70 */ GRUB_KEYBOARD_KEY_NUMDOT, GRUB_KEYBOARD_KEY_NUM0, + /* 0x72 */ GRUB_KEYBOARD_KEY_NUM2, GRUB_KEYBOARD_KEY_NUM5, + /* 0x74 */ GRUB_KEYBOARD_KEY_NUM6, GRUB_KEYBOARD_KEY_NUM8, + /* 0x76 */ GRUB_KEYBOARD_KEY_ESCAPE, GRUB_KEYBOARD_KEY_NUM_LOCK, + /* 0x78 */ GRUB_KEYBOARD_KEY_F11, GRUB_KEYBOARD_KEY_NUMPLUS, + /* 0x7a */ GRUB_KEYBOARD_KEY_NUM3, GRUB_KEYBOARD_KEY_NUMMINUS, + /* 0x7c */ GRUB_KEYBOARD_KEY_NUMMUL, GRUB_KEYBOARD_KEY_NUM9, + /* 0x7e */ GRUB_KEYBOARD_KEY_SCROLL_LOCK, 0, + /* 0x80 */ 0, 0, + /* 0x82 */ 0, GRUB_KEYBOARD_KEY_F7, }; static const struct @@ -162,18 +195,18 @@ static const struct { {0x11, GRUB_KEYBOARD_KEY_RIGHT_ALT}, {0x14, GRUB_KEYBOARD_KEY_RIGHT_CTRL}, - {0x4a, 0x54}, /* Num / */ - {0x5a, 0x58}, /* Num enter */ - {0x69, 0x4d}, /* End */ - {0x6b, 0x50}, /* Left */ - {0x6c, 0x4a}, /* Home */ - {0x70, 0x49}, /* Insert */ - {0x71, 0x4c}, /* Delete */ - {0x72, 0x51}, /* Down */ - {0x74, 0x4f}, /* Right */ - {0x75, 0x52}, /* Up */ - {0x7a, 0x4e}, /* PageDown */ - {0x7d, 0x4b}, /* PageUp */ + {0x4a, GRUB_KEYBOARD_KEY_NUMSLASH}, + {0x5a, GRUB_KEYBOARD_KEY_NUMENTER}, + {0x69, GRUB_KEYBOARD_KEY_END}, + {0x6b, GRUB_KEYBOARD_KEY_LEFT}, + {0x6c, GRUB_KEYBOARD_KEY_HOME}, + {0x70, GRUB_KEYBOARD_KEY_INSERT}, + {0x71, GRUB_KEYBOARD_KEY_DELETE}, + {0x72, GRUB_KEYBOARD_KEY_DOWN}, + {0x74, GRUB_KEYBOARD_KEY_RIGHT}, + {0x75, GRUB_KEYBOARD_KEY_UP}, + {0x7a, GRUB_KEYBOARD_KEY_NPAGE}, + {0x7d, GRUB_KEYBOARD_KEY_PPAGE}, }; static void diff --git a/util/grub-mklayout.c b/util/grub-mklayout.c index fc8ffb67a..e22888fc5 100644 --- a/util/grub-mklayout.c +++ b/util/grub-mklayout.c @@ -192,62 +192,62 @@ static struct console_grub_equivalence console_grub_equivalences_common[] = { }; static grub_uint8_t linux_to_usb_map[128] = { - /* 0x00 */ 0x00 /* Unused */, 0x29 /* Escape */, - /* 0x02 */ 0x1e /* 1 */, 0x1f /* 2 */, - /* 0x04 */ 0x20 /* 3 */, 0x21 /* 4 */, - /* 0x06 */ 0x22 /* 5 */, 0x23 /* 6 */, - /* 0x08 */ 0x24 /* 7 */, 0x25 /* 8 */, - /* 0x0a */ 0x26 /* 9 */, 0x27 /* 0 */, - /* 0x0c */ 0x2d /* - */, 0x2e /* = */, - /* 0x0e */ 0x2a /* \b */, 0x2b /* \t */, - /* 0x10 */ 0x14 /* q */, 0x1a /* w */, - /* 0x12 */ 0x08 /* e */, 0x15 /* r */, - /* 0x14 */ 0x17 /* t */, 0x1c /* y */, - /* 0x16 */ 0x18 /* u */, 0x0c /* i */, - /* 0x18 */ 0x12 /* o */, 0x13 /* p */, - /* 0x1a */ 0x2f /* [ */, 0x30 /* ] */, - /* 0x1c */ 0x28 /* Enter */, 0x00 /* Left CTRL */, - /* 0x1e */ 0x04 /* a */, 0x16 /* s */, - /* 0x20 */ 0x07 /* d */, 0x09 /* f */, - /* 0x22 */ 0x0a /* g */, 0x0b /* h */, - /* 0x24 */ 0x0d /* j */, 0x0e /* k */, - /* 0x26 */ 0x0f /* l */, 0x33 /* ; */, - /* 0x28 */ 0x34 /* " */, 0x35 /* ` */, - /* 0x2a */ 0x00 /* Left Shift */, 0x32 /* \ */, - /* 0x2c */ 0x1d /* z */, 0x1b /* x */, - /* 0x2e */ 0x06 /* c */, 0x19 /* v */, - /* 0x30 */ 0x05 /* b */, 0x11 /* n */, - /* 0x32 */ 0x10 /* m */, 0x36 /* , */, - /* 0x34 */ 0x37 /* . */, 0x38 /* / */, - /* 0x36 */ 0x00 /* Right Shift */, 0x55 /* Num * */, - /* 0x38 */ 0x00 /* Left ALT */, 0x2c /* Space */, - /* 0x3a */ 0x39 /* Caps Lock */, 0x3a /* F1 */, - /* 0x3c */ 0x3b /* F2 */, 0x3c /* F3 */, - /* 0x3e */ 0x3d /* F4 */, 0x3e /* F5 */, - /* 0x40 */ 0x3f /* F6 */, 0x40 /* F7 */, - /* 0x42 */ 0x41 /* F8 */, 0x42 /* F9 */, - /* 0x44 */ 0x43 /* F10 */, 0x53 /* NumLock */, - /* 0x46 */ 0x47 /* Scroll Lock */, 0x5f /* Num 7 */, - /* 0x48 */ 0x60 /* Num 8 */, 0x61 /* Num 9 */, - /* 0x4a */ 0x56 /* Num - */, 0x5c /* Num 4 */, - /* 0x4c */ 0x5d /* Num 5 */, 0x5e /* Num 6 */, - /* 0x4e */ 0x57 /* Num + */, 0x59 /* Num 1 */, - /* 0x50 */ 0x5a /* Num 2 */, 0x5b /* Num 3 */, - /* 0x52 */ 0x62 /* Num 0 */, 0x63 /* Num . */, - /* 0x54 */ 0x00, 0x00, - /* 0x56 */ 0x64 /* 102nd key. */, 0x44 /* F11 */, - /* 0x58 */ 0x45 /* F12 */, 0x00, - /* 0x5a */ 0x00, 0x00, - /* 0x5c */ 0x00, 0x00, - /* 0x5e */ 0x00, 0x00, - /* 0x60 */ 0x58 /* Num \n */, 0x00 /* Right CTRL */, - /* 0x62 */ 0x54 /* Num / */, 0x00, - /* 0x64 */ 0x00 /* Right ALT */, 0x00, - /* 0x66 */ 0x4a /* Home */, 0x52 /* Up */, - /* 0x68 */ 0x4e /* NPage */, 0x50 /* Left */, - /* 0x6a */ 0x4f /* Right */, 0x4d /* End */, - /* 0x6c */ 0x51 /* Down */, 0x4b /* PPage */, - /* 0x6e */ 0x49 /* Insert */, 0x4c /* DC */ + /* 0x00 */ 0 /* Unused */, GRUB_KEYBOARD_KEY_ESCAPE, + /* 0x02 */ GRUB_KEYBOARD_KEY_1, GRUB_KEYBOARD_KEY_2, + /* 0x04 */ GRUB_KEYBOARD_KEY_3, GRUB_KEYBOARD_KEY_4, + /* 0x06 */ GRUB_KEYBOARD_KEY_5, GRUB_KEYBOARD_KEY_6, + /* 0x08 */ GRUB_KEYBOARD_KEY_7, GRUB_KEYBOARD_KEY_8, + /* 0x0a */ GRUB_KEYBOARD_KEY_9, GRUB_KEYBOARD_KEY_0, + /* 0x0c */ GRUB_KEYBOARD_KEY_DASH, GRUB_KEYBOARD_KEY_EQUAL, + /* 0x0e */ GRUB_KEYBOARD_KEY_BACKSPACE, GRUB_KEYBOARD_KEY_TAB, + /* 0x10 */ GRUB_KEYBOARD_KEY_Q, GRUB_KEYBOARD_KEY_W, + /* 0x12 */ GRUB_KEYBOARD_KEY_E, GRUB_KEYBOARD_KEY_R, + /* 0x14 */ GRUB_KEYBOARD_KEY_T, GRUB_KEYBOARD_KEY_Y, + /* 0x16 */ GRUB_KEYBOARD_KEY_U, GRUB_KEYBOARD_KEY_I, + /* 0x18 */ GRUB_KEYBOARD_KEY_O, GRUB_KEYBOARD_KEY_P, + /* 0x1a */ GRUB_KEYBOARD_KEY_LBRACKET, GRUB_KEYBOARD_KEY_RBRACKET, + /* 0x1c */ GRUB_KEYBOARD_KEY_ENTER, GRUB_KEYBOARD_KEY_LEFT_CTRL, + /* 0x1e */ GRUB_KEYBOARD_KEY_A, GRUB_KEYBOARD_KEY_S, + /* 0x20 */ GRUB_KEYBOARD_KEY_D, GRUB_KEYBOARD_KEY_F, + /* 0x22 */ GRUB_KEYBOARD_KEY_G, GRUB_KEYBOARD_KEY_H, + /* 0x24 */ GRUB_KEYBOARD_KEY_J, GRUB_KEYBOARD_KEY_K, + /* 0x26 */ GRUB_KEYBOARD_KEY_L, GRUB_KEYBOARD_KEY_SEMICOLON, + /* 0x28 */ GRUB_KEYBOARD_KEY_DQUOTE, GRUB_KEYBOARD_KEY_RQUOTE, + /* 0x2a */ GRUB_KEYBOARD_KEY_LEFT_SHIFT, GRUB_KEYBOARD_KEY_BACKSLASH, + /* 0x2c */ GRUB_KEYBOARD_KEY_Z, GRUB_KEYBOARD_KEY_X, + /* 0x2e */ GRUB_KEYBOARD_KEY_C, GRUB_KEYBOARD_KEY_V, + /* 0x30 */ GRUB_KEYBOARD_KEY_B, GRUB_KEYBOARD_KEY_N, + /* 0x32 */ GRUB_KEYBOARD_KEY_M, GRUB_KEYBOARD_KEY_COMMA, + /* 0x34 */ GRUB_KEYBOARD_KEY_DOT, GRUB_KEYBOARD_KEY_SLASH, + /* 0x36 */ GRUB_KEYBOARD_KEY_RIGHT_SHIFT, GRUB_KEYBOARD_KEY_NUMMUL, + /* 0x38 */ GRUB_KEYBOARD_KEY_LEFT_ALT, GRUB_KEYBOARD_KEY_SPACE, + /* 0x3a */ GRUB_KEYBOARD_KEY_CAPS_LOCK, GRUB_KEYBOARD_KEY_F1, + /* 0x3c */ GRUB_KEYBOARD_KEY_F2, GRUB_KEYBOARD_KEY_F3, + /* 0x3e */ GRUB_KEYBOARD_KEY_F4, GRUB_KEYBOARD_KEY_F5, + /* 0x40 */ GRUB_KEYBOARD_KEY_F6, GRUB_KEYBOARD_KEY_F7, + /* 0x42 */ GRUB_KEYBOARD_KEY_F8, GRUB_KEYBOARD_KEY_F9, + /* 0x44 */ GRUB_KEYBOARD_KEY_F10, GRUB_KEYBOARD_KEY_NUM_LOCK, + /* 0x46 */ GRUB_KEYBOARD_KEY_SCROLL_LOCK, GRUB_KEYBOARD_KEY_NUM7, + /* 0x48 */ GRUB_KEYBOARD_KEY_NUM8, GRUB_KEYBOARD_KEY_NUM9, + /* 0x4a */ GRUB_KEYBOARD_KEY_NUMMINUS, GRUB_KEYBOARD_KEY_NUM4, + /* 0x4c */ GRUB_KEYBOARD_KEY_NUM5, GRUB_KEYBOARD_KEY_NUM6, + /* 0x4e */ GRUB_KEYBOARD_KEY_NUMPLUS, GRUB_KEYBOARD_KEY_NUM1, + /* 0x50 */ GRUB_KEYBOARD_KEY_NUM2, GRUB_KEYBOARD_KEY_NUM3, + /* 0x52 */ GRUB_KEYBOARD_KEY_NUMDOT, GRUB_KEYBOARD_KEY_NUMDOT, + /* 0x54 */ 0, 0, + /* 0x56 */ GRUB_KEYBOARD_KEY_102ND, GRUB_KEYBOARD_KEY_F11, + /* 0x58 */ GRUB_KEYBOARD_KEY_F12, 0, + /* 0x5a */ 0, 0, + /* 0x5c */ 0, 0, + /* 0x5e */ 0, 0, + /* 0x60 */ GRUB_KEYBOARD_KEY_NUMENTER, GRUB_KEYBOARD_KEY_RIGHT_CTRL, + /* 0x62 */ GRUB_KEYBOARD_KEY_NUMSLASH, 0, + /* 0x64 */ GRUB_KEYBOARD_KEY_RIGHT_ALT, 0, + /* 0x66 */ GRUB_KEYBOARD_KEY_HOME, GRUB_KEYBOARD_KEY_UP, + /* 0x68 */ GRUB_KEYBOARD_KEY_NPAGE, GRUB_KEYBOARD_KEY_LEFT, + /* 0x6a */ GRUB_KEYBOARD_KEY_RIGHT, GRUB_KEYBOARD_KEY_END, + /* 0x6c */ GRUB_KEYBOARD_KEY_DOWN, GRUB_KEYBOARD_KEY_PPAGE, + /* 0x6e */ GRUB_KEYBOARD_KEY_INSERT, GRUB_KEYBOARD_KEY_DELETE }; static void