From 2e10aabe94614ac4b221294190e6b61559762933 Mon Sep 17 00:00:00 2001 From: longpanda Date: Wed, 24 Mar 2021 22:08:10 +0800 Subject: [PATCH] Add VTOY_DEFAULT_KBD_LAYOUT in global control plugin --- .../grub-core/term/keyboard_layout.c | 795 ++++++++++++++++++ .../MOD_SRC/grub-2.04/grub-core/term/setkey.c | 28 +- INSTALL/grub/arm64-efi/command.lst | 1 + INSTALL/grub/arm64-efi/moddep.lst | 2 +- INSTALL/grub/debug.cfg | 2 +- INSTALL/grub/grub.cfg | 3 + INSTALL/grub/i386-efi/command.lst | 1 + INSTALL/grub/i386-efi/moddep.lst | 2 +- INSTALL/grub/i386-pc/command.lst | 1 + INSTALL/grub/i386-pc/moddep.lst | 2 +- INSTALL/grub/keyboard.cfg | 62 ++ INSTALL/grub/keyboard.cfg.gz | Bin 2416 -> 0 bytes INSTALL/grub/mips64el-efi/command.lst | Bin 1068 -> 1080 bytes INSTALL/grub/mips64el-efi/moddep.lst | Bin 1616 -> 1616 bytes INSTALL/grub/x86_64-efi/command.lst | 1 + INSTALL/grub/x86_64-efi/moddep.lst | 2 +- KBD/keyboard_layout.c | 795 ++++++++++++++++++ KBD/mkconfig.sh | 64 +- 18 files changed, 1750 insertions(+), 11 deletions(-) create mode 100644 GRUB2/MOD_SRC/grub-2.04/grub-core/term/keyboard_layout.c create mode 100644 INSTALL/grub/keyboard.cfg delete mode 100644 INSTALL/grub/keyboard.cfg.gz create mode 100644 KBD/keyboard_layout.c diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/term/keyboard_layout.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/term/keyboard_layout.c new file mode 100644 index 00000000..8d139b5f --- /dev/null +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/term/keyboard_layout.c @@ -0,0 +1,795 @@ + +#define ventoy_keyboard_set_layout(name) if (grub_strcmp(layout, #name) == 0) return ventoy_keyboard_layout_##name() + +static void ventoy_keyboard_layout_QWERTY_USA(void) { + grub_keymap_reset(); + grub_keymap_disable(); +} +static void ventoy_keyboard_layout_AZERTY(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("a", "q"); +grub_keymap_add_by_string("A", "Q"); +grub_keymap_add_by_string("z", "w"); +grub_keymap_add_by_string("Z", "W"); +grub_keymap_add_by_string("q", "a"); +grub_keymap_add_by_string("Q", "A"); +grub_keymap_add_by_string("m", "semicolon"); +grub_keymap_add_by_string("M", "colon"); +grub_keymap_add_by_string("w", "z"); +grub_keymap_add_by_string("W", "Z"); +grub_keymap_add_by_string("comma", "m"); +grub_keymap_add_by_string("question", "M"); +grub_keymap_add_by_string("semicolon", "comma"); +grub_keymap_add_by_string("period", "less"); +grub_keymap_add_by_string("colon", "period"); +grub_keymap_add_by_string("slash", "greater"); +grub_keymap_add_by_string("exclam", "slash"); +grub_keymap_add_by_string("dollar", "bracketright"); +grub_keymap_add_by_string("asterisk", "backslash"); +grub_keymap_add_by_string("percent", "doublequote"); +grub_keymap_add_by_string("ampersand", "1"); +grub_keymap_add_by_string("1", "exclam"); +grub_keymap_add_by_string("tilde", "2"); +grub_keymap_add_by_string("2", "at"); +grub_keymap_add_by_string("doublequote", "3"); +grub_keymap_add_by_string("3", "numbersign"); +grub_keymap_add_by_string("quote", "4"); +grub_keymap_add_by_string("4", "dollar"); +grub_keymap_add_by_string("parenleft", "5"); +grub_keymap_add_by_string("5", "percent"); +grub_keymap_add_by_string("minus", "6"); +grub_keymap_add_by_string("6", "caret"); +grub_keymap_add_by_string("backquote", "7"); +grub_keymap_add_by_string("7", "ampersand"); +grub_keymap_add_by_string("underscore", "8"); +grub_keymap_add_by_string("8", "asterisk"); +grub_keymap_add_by_string("caret", "9"); +grub_keymap_add_by_string("9", "parenleft"); +grub_keymap_add_by_string("at", "0"); +grub_keymap_add_by_string("0", "parenright"); +grub_keymap_add_by_string("parenright", "minus"); +grub_keymap_add_by_string("less", "backquote"); +grub_keymap_add_by_string("greater", "tilde"); +grub_keymap_add_by_string("numbersign", "braceright"); +grub_keymap_add_by_string("backslash", "question"); +grub_keymap_add_by_string("bracketright", "braceleft"); +grub_keymap_add_by_string("braceleft", "quote"); +grub_keymap_add_by_string("braceright", "underscore"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_CZECH_QWERTY(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("semicolon", "backquote"); +grub_keymap_add_by_string("plus", "1"); +grub_keymap_add_by_string("equal", "minus"); +grub_keymap_add_by_string("quote", "equal"); +grub_keymap_add_by_string("parenright", "bracketright"); +grub_keymap_add_by_string("doublequote", "backslash"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("1", "exclam"); +grub_keymap_add_by_string("2", "at"); +grub_keymap_add_by_string("3", "numbersign"); +grub_keymap_add_by_string("4", "dollar"); +grub_keymap_add_by_string("5", "percent"); +grub_keymap_add_by_string("6", "caret"); +grub_keymap_add_by_string("7", "ampersand"); +grub_keymap_add_by_string("8", "asterisk"); +grub_keymap_add_by_string("9", "parenleft"); +grub_keymap_add_by_string("0", "parenright"); +grub_keymap_add_by_string("percent", "underscore"); +grub_keymap_add_by_string("slash", "braceleft"); +grub_keymap_add_by_string("parenleft", "braceright"); +grub_keymap_add_by_string("doublequote", "colon"); +grub_keymap_add_by_string("exclam", "doublequote"); +grub_keymap_add_by_string("quote", "bar"); +grub_keymap_add_by_string("question", "less"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("backquote", "Abackquote"); +grub_keymap_add_by_string("exclam", "A1"); +grub_keymap_add_by_string("at", "A2"); +grub_keymap_add_by_string("numbersign", "A3"); +grub_keymap_add_by_string("dollar", "A4"); +grub_keymap_add_by_string("percent", "A5"); +grub_keymap_add_by_string("caret", "A6"); +grub_keymap_add_by_string("ampersand", "A7"); +grub_keymap_add_by_string("asterisk", "A8"); +grub_keymap_add_by_string("parenleft", "A9"); +grub_keymap_add_by_string("parenright", "A0"); +grub_keymap_add_by_string("minus", "Aminus"); +grub_keymap_add_by_string("equal", "Aequal"); +grub_keymap_add_by_string("bracketleft", "Abracketleft"); +grub_keymap_add_by_string("bracketright", "Abracketright"); +grub_keymap_add_by_string("semicolon", "Asemicolon"); +grub_keymap_add_by_string("backslash", "Abackslash"); +grub_keymap_add_by_string("less", "Acomma"); +grub_keymap_add_by_string("greater", "Aperiod"); +grub_keymap_add_by_string("slash", "Aslash"); +grub_keymap_add_by_string("tilde", "Atilde"); +grub_keymap_add_by_string("underscore", "Aunderscore"); +grub_keymap_add_by_string("plus", "Aplus"); +grub_keymap_add_by_string("braceleft", "Abraceleft"); +grub_keymap_add_by_string("braceright", "Abraceright"); +grub_keymap_add_by_string("caret", "Adoublequote"); +grub_keymap_add_by_string("colon", "Acolon"); +grub_keymap_add_by_string("question", "Aquestion"); +grub_keymap_add_by_string("bar", "Abar"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_CZECH_QWERTZ(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("y", "z"); +grub_keymap_add_by_string("z", "y"); +grub_keymap_add_by_string("Y", "Z"); +grub_keymap_add_by_string("Z", "Y"); +grub_keymap_add_by_string("semicolon", "backquote"); +grub_keymap_add_by_string("plus", "1"); +grub_keymap_add_by_string("equal", "minus"); +grub_keymap_add_by_string("quote", "equal"); +grub_keymap_add_by_string("parenright", "bracketright"); +grub_keymap_add_by_string("doublequote", "backslash"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("1", "exclam"); +grub_keymap_add_by_string("2", "at"); +grub_keymap_add_by_string("3", "numbersign"); +grub_keymap_add_by_string("4", "dollar"); +grub_keymap_add_by_string("5", "percent"); +grub_keymap_add_by_string("6", "caret"); +grub_keymap_add_by_string("7", "ampersand"); +grub_keymap_add_by_string("8", "asterisk"); +grub_keymap_add_by_string("9", "parenleft"); +grub_keymap_add_by_string("0", "parenright"); +grub_keymap_add_by_string("percent", "underscore"); +grub_keymap_add_by_string("slash", "braceleft"); +grub_keymap_add_by_string("parenleft", "braceright"); +grub_keymap_add_by_string("doublequote", "colon"); +grub_keymap_add_by_string("exclam", "doublequote"); +grub_keymap_add_by_string("quote", "bar"); +grub_keymap_add_by_string("question", "less"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("tilde", "A1"); +grub_keymap_add_by_string("caret", "A3"); +grub_keymap_add_by_string("backslash", "Aq"); +grub_keymap_add_by_string("bar", "Aw"); +grub_keymap_add_by_string("bracketleft", "Af"); +grub_keymap_add_by_string("bracketright", "Ag"); +grub_keymap_add_by_string("dollar", "Asemicolon"); +grub_keymap_add_by_string("numbersign", "Ax"); +grub_keymap_add_by_string("ampersand", "Ac"); +grub_keymap_add_by_string("at", "Av"); +grub_keymap_add_by_string("braceleft", "Ab"); +grub_keymap_add_by_string("braceright", "An"); +grub_keymap_add_by_string("less", "Acomma"); +grub_keymap_add_by_string("greater", "Aperiod"); +grub_keymap_add_by_string("asterisk", "Aslash"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_DANISH(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("plus", "minus"); +grub_keymap_add_by_string("quote", "equal"); +grub_keymap_add_by_string("doublequote", "bracketright"); +grub_keymap_add_by_string("quote", "backslash"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("ampersand", "caret"); +grub_keymap_add_by_string("slash", "ampersand"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("equal", "parenright"); +grub_keymap_add_by_string("question", "underscore"); +grub_keymap_add_by_string("caret", "braceright"); +grub_keymap_add_by_string("asterisk", "bar"); +grub_keymap_add_by_string("backquote", "plus"); +grub_keymap_add_by_string("semicolon", "less"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("bar", "Atilde"); +grub_keymap_add_by_string("backslash", "Abackquote"); +grub_keymap_add_by_string("greater", "tilde"); +grub_keymap_add_by_string("at", "A2"); +grub_keymap_add_by_string("dollar", "A4"); +grub_keymap_add_by_string("braceleft", "A7"); +grub_keymap_add_by_string("bracketleft", "A8"); +grub_keymap_add_by_string("bracketright", "A9"); +grub_keymap_add_by_string("braceright", "A0"); +grub_keymap_add_by_string("backslash", "Aminus"); +grub_keymap_add_by_string("less", "quote"); +grub_keymap_add_by_string("greater", "doublequote"); +grub_keymap_add_by_string("tilde", "Abracketright"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_DVORAK_USA(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("[", "minus"); +grub_keymap_add_by_string("braceleft", "underscore"); +grub_keymap_add_by_string("quote", "q"); +grub_keymap_add_by_string("doublequote", "Q"); +grub_keymap_add_by_string("comma", "w"); +grub_keymap_add_by_string("less", "W"); +grub_keymap_add_by_string("s", "semicolon"); +grub_keymap_add_by_string("S", "colon"); +grub_keymap_add_by_string("semicolon", "z"); +grub_keymap_add_by_string("colon", "Z"); +grub_keymap_add_by_string("w", "comma"); +grub_keymap_add_by_string("W", "less"); +grub_keymap_add_by_string("v", "period"); +grub_keymap_add_by_string("z", "greater"); +grub_keymap_add_by_string("z", "slash"); +grub_keymap_add_by_string("equal", "bracketright"); +grub_keymap_add_by_string("backslash", "backslash"); +grub_keymap_add_by_string("underscore", "doublequote"); +grub_keymap_add_by_string("quote", "q"); +grub_keymap_add_by_string("doublequote", "Q"); +grub_keymap_add_by_string("comma", "w"); +grub_keymap_add_by_string("less", "W"); +grub_keymap_add_by_string("period", "e"); +grub_keymap_add_by_string("greater", "E"); +grub_keymap_add_by_string("p", "r"); +grub_keymap_add_by_string("P", "R"); +grub_keymap_add_by_string("y", "t"); +grub_keymap_add_by_string("Y", "T"); +grub_keymap_add_by_string("f", "y"); +grub_keymap_add_by_string("F", "Y"); +grub_keymap_add_by_string("g", "u"); +grub_keymap_add_by_string("G", "U"); +grub_keymap_add_by_string("c", "c"); +grub_keymap_add_by_string("C", "I"); +grub_keymap_add_by_string("r", "o"); +grub_keymap_add_by_string("R", "O"); +grub_keymap_add_by_string("l", "p"); +grub_keymap_add_by_string("L", "P"); +grub_keymap_add_by_string("bracketright", "equal"); +grub_keymap_add_by_string("braceright", "plus"); +grub_keymap_add_by_string("a", "a"); +grub_keymap_add_by_string("A", "A"); +grub_keymap_add_by_string("o", "s"); +grub_keymap_add_by_string("O", "S"); +grub_keymap_add_by_string("e", "d"); +grub_keymap_add_by_string("E", "D"); +grub_keymap_add_by_string("u", "f"); +grub_keymap_add_by_string("U", "F"); +grub_keymap_add_by_string("i", "g"); +grub_keymap_add_by_string("I", "G"); +grub_keymap_add_by_string("d", "h"); +grub_keymap_add_by_string("D", "H"); +grub_keymap_add_by_string("h", "j"); +grub_keymap_add_by_string("H", "J"); +grub_keymap_add_by_string("t", "k"); +grub_keymap_add_by_string("T", "K"); +grub_keymap_add_by_string("n", "l"); +grub_keymap_add_by_string("N", "L"); +grub_keymap_add_by_string("s", "semicolon"); +grub_keymap_add_by_string("S", "colon"); +grub_keymap_add_by_string("minus", "quote"); +grub_keymap_add_by_string("underscore", "doublequote"); +grub_keymap_add_by_string("semicolon", "z"); +grub_keymap_add_by_string("colon", "Z"); +grub_keymap_add_by_string("q", "x"); +grub_keymap_add_by_string("Q", "X"); +grub_keymap_add_by_string("j", "c"); +grub_keymap_add_by_string("J", "C"); +grub_keymap_add_by_string("k", "v"); +grub_keymap_add_by_string("K", "V"); +grub_keymap_add_by_string("x", "b"); +grub_keymap_add_by_string("X", "B"); +grub_keymap_add_by_string("b", "n"); +grub_keymap_add_by_string("B", "N"); +grub_keymap_add_by_string("w", "comma"); +grub_keymap_add_by_string("W", "less"); +grub_keymap_add_by_string("v", "period"); +grub_keymap_add_by_string("V", "greater"); +grub_keymap_add_by_string("z", "slash"); +grub_keymap_add_by_string("Z", "question"); +grub_keymap_add_by_string("slash", "bracketleft"); +grub_keymap_add_by_string("question", "braceleft"); +grub_keymap_add_by_string("equal", "bracketright"); +grub_keymap_add_by_string("plus", "braceright"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_FRENCH(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("less", "backquote"); +grub_keymap_add_by_string("greater", "tilde"); +grub_keymap_add_by_string("ampersand", "1"); +grub_keymap_add_by_string("1", "exclam"); +grub_keymap_add_by_string("tilde", "2"); +grub_keymap_add_by_string("2", "at"); +grub_keymap_add_by_string("doublequote", "3"); +grub_keymap_add_by_string("3", "numbersign"); +grub_keymap_add_by_string("quote", "4"); +grub_keymap_add_by_string("4", "dollar"); +grub_keymap_add_by_string("parenleft", "5"); +grub_keymap_add_by_string("5", "percent"); +grub_keymap_add_by_string("minus", "6"); +grub_keymap_add_by_string("6", "caret"); +grub_keymap_add_by_string("backquote", "7"); +grub_keymap_add_by_string("7", "ampersand"); +grub_keymap_add_by_string("underscore", "8"); +grub_keymap_add_by_string("8", "asterisk"); +grub_keymap_add_by_string("backslash", "9"); +grub_keymap_add_by_string("9", "parenleft"); +grub_keymap_add_by_string("at", "0"); +grub_keymap_add_by_string("0", "parenright"); +grub_keymap_add_by_string("parenright", "minus"); +grub_keymap_add_by_string("numbersign", "underscore"); +grub_keymap_add_by_string("a", "q"); +grub_keymap_add_by_string("A", "Q"); +grub_keymap_add_by_string("z", "w"); +grub_keymap_add_by_string("Z", "W"); +grub_keymap_add_by_string("caret", "bracketleft"); +grub_keymap_add_by_string("dollar", "bracketright"); +grub_keymap_add_by_string("q", "a"); +grub_keymap_add_by_string("Q", "A"); +grub_keymap_add_by_string("m", "semicolon"); +grub_keymap_add_by_string("M", "colon"); +grub_keymap_add_by_string("bracketleft", "quote"); +grub_keymap_add_by_string("percent", "doublequote"); +grub_keymap_add_by_string("asterisk", "backslash"); +grub_keymap_add_by_string("bracketright", "bar"); +grub_keymap_add_by_string("w", "z"); +grub_keymap_add_by_string("W", "Z"); +grub_keymap_add_by_string("comma", "m"); +grub_keymap_add_by_string("question", "M"); +grub_keymap_add_by_string("semicolon", "comma"); +grub_keymap_add_by_string("period", "less"); +grub_keymap_add_by_string("colon", "period"); +grub_keymap_add_by_string("slash", "greater"); +grub_keymap_add_by_string("exclam", "slash"); +grub_keymap_add_by_string("bar", "question"); +grub_keymap_add_by_string("tilde", "A2"); +grub_keymap_add_by_string("numbersign", "A3"); +grub_keymap_add_by_string("braceleft", "A4"); +grub_keymap_add_by_string("bracketleft", "A5"); +grub_keymap_add_by_string("bar", "A6"); +grub_keymap_add_by_string("quote", "A7"); +grub_keymap_add_by_string("backslash", "A8"); +grub_keymap_add_by_string("caret", "A9"); +grub_keymap_add_by_string("at", "A0"); +grub_keymap_add_by_string("bracketright", "Aminus"); +grub_keymap_add_by_string("braceright", "Aequal"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_GERMAN(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("ampersand", "caret"); +grub_keymap_add_by_string("slash", "ampersand"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("equal", "parenright"); +grub_keymap_add_by_string("question", "underscore"); +grub_keymap_add_by_string("backslash", "minus"); +grub_keymap_add_by_string("z", "y"); +grub_keymap_add_by_string("Z", "Y"); +grub_keymap_add_by_string("y", "z"); +grub_keymap_add_by_string("Y", "Z"); +grub_keymap_add_by_string("plus", "bracketright"); +grub_keymap_add_by_string("asterisk", "braceright"); +grub_keymap_add_by_string("semicolon", "less"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("backslash", "Aminus"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("caret", "backquote"); +grub_keymap_add_by_string("quote", "equal"); +grub_keymap_add_by_string("backquote", "plus"); +grub_keymap_add_by_string("braceright", "doublequote"); +grub_keymap_add_by_string("bar", "bracketleft"); +grub_keymap_add_by_string("at", "braceleft"); +grub_keymap_add_by_string("numbersign", "backslash"); +grub_keymap_add_by_string("at", "Aq"); +grub_keymap_add_by_string("less", "backquote"); +grub_keymap_add_by_string("greater", "tilde"); +grub_keymap_add_by_string("braceleft", "A7"); +grub_keymap_add_by_string("bracketleft", "A8"); +grub_keymap_add_by_string("bracketright", "A9"); +grub_keymap_add_by_string("braceright", "A0"); +grub_keymap_add_by_string("tilde", "Abracketright"); +grub_keymap_add_by_string("backslash", "Aminus"); +grub_keymap_add_by_string("quote", "bar"); +grub_keymap_add_by_string("greater", "semicolon"); +grub_keymap_add_by_string("less", "colon"); +grub_keymap_add_by_string("bar", "quote"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_ITALIANO(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("backslash", "backquote"); +grub_keymap_add_by_string("bar", "tilde"); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("tilde", "numbersign"); +grub_keymap_add_by_string("ampersand", "caret"); +grub_keymap_add_by_string("slash", "ampersand"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("equal", "parenright"); +grub_keymap_add_by_string("quote", "minus"); +grub_keymap_add_by_string("question", "underscore"); +grub_keymap_add_by_string("caret", "plus"); +grub_keymap_add_by_string("bracketleft", "bracketleft"); +grub_keymap_add_by_string("bracketright", "braceleft"); +grub_keymap_add_by_string("plus", "bracketright"); +grub_keymap_add_by_string("asterisk", "braceright"); +grub_keymap_add_by_string("at", "semicolon"); +grub_keymap_add_by_string("braceleft", "colon"); +grub_keymap_add_by_string("numbersign", "quote"); +grub_keymap_add_by_string("braceright", "doublequote"); +grub_keymap_add_by_string("less", "backslash"); +grub_keymap_add_by_string("greater", "bar"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("semicolon", "less"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("bracketleft", "Abracketleft"); +grub_keymap_add_by_string("bracketright", "Abracketright"); +grub_keymap_add_by_string("at", "Asemicolon"); +grub_keymap_add_by_string("numbersign", "Aquote"); +grub_keymap_add_by_string("braceright", "Abraceright"); +grub_keymap_add_by_string("braceleft", "Abraceleft"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_JAPAN_106(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("at", "bracketleft"); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("ampersand", "caret"); +grub_keymap_add_by_string("quote", "ampersand"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("underscore", "parenright"); +grub_keymap_add_by_string("equal", "underscore"); +grub_keymap_add_by_string("plus", "colon"); +grub_keymap_add_by_string("colon", "quote"); +grub_keymap_add_by_string("asterisk", "doublequote"); +grub_keymap_add_by_string("bracketleft", "bracketright"); +grub_keymap_add_by_string("braceleft", "braceright"); +grub_keymap_add_by_string("bracketright", "backslash"); +grub_keymap_add_by_string("braceright", "bar"); +grub_keymap_add_by_string("backslash", "backquote"); +grub_keymap_add_by_string("tilde", "plus"); +grub_keymap_add_by_string("caret", "equal"); +grub_keymap_add_by_string("backquote", "braceleft"); +grub_keymap_add_by_string("bar", "tilde"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_LATIN_USA(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("bar", "backquote"); +grub_keymap_add_by_string("quote", "minus"); +grub_keymap_add_by_string("question", "underscore"); +grub_keymap_add_by_string("backquote", "bracketleft"); +grub_keymap_add_by_string("plus", "bracketright"); +grub_keymap_add_by_string("braceleft", "quote"); +grub_keymap_add_by_string("braceright", "backslash"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("ampersand", "caret"); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("slash", "ampersand"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("equal", "parenright"); +grub_keymap_add_by_string("asterisk", "braceright"); +grub_keymap_add_by_string("bracketleft", "doublequote"); +grub_keymap_add_by_string("bracketright", "bar"); +grub_keymap_add_by_string("semicolon", "less"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("caret", "Aquote"); +grub_keymap_add_by_string("doublequote", "braceleft"); +grub_keymap_add_by_string("at", "Aq"); +grub_keymap_add_by_string("backquote", "Abackslash"); +grub_keymap_add_by_string("backslash", "Aminus"); +grub_keymap_add_by_string("greater", "plus"); +grub_keymap_add_by_string("less", "equal"); +grub_keymap_add_by_string("backslash", "Aminus"); +grub_keymap_add_by_string("backquote", "Abackslash"); +grub_keymap_add_by_string("tilde", "Abracketright"); +grub_keymap_add_by_string("caret", "Aquote"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_PORTU_BRAZIL(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("quote", "backquote"); +grub_keymap_add_by_string("quote", "bracketleft"); +grub_keymap_add_by_string("bracketleft", "bracketright"); +grub_keymap_add_by_string("tilde", "quote"); +grub_keymap_add_by_string("bracketright", "backslash"); +grub_keymap_add_by_string("semicolon", "slash"); +grub_keymap_add_by_string("bar", "colon"); +grub_keymap_add_by_string("doublequote", "tilde"); +grub_keymap_add_by_string("backquote", "braceleft"); +grub_keymap_add_by_string("braceleft", "braceright"); +grub_keymap_add_by_string("caret", "doublequote"); +grub_keymap_add_by_string("braceright", "bar"); +grub_keymap_add_by_string("colon", "question"); +grub_keymap_add_by_string("backslash", "semicolon"); +grub_keymap_add_by_string("bar", "Atilde"); +grub_keymap_add_by_string("backslash", "Abackquote"); +grub_keymap_add_by_string("slash", "Aq"); +grub_keymap_add_by_string("question", "Aw"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_QWERTY_UK(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("at", "doublequote"); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("tilde", "bar"); +grub_keymap_add_by_string("numbersign", "backslash"); +grub_keymap_add_by_string("backslash", "numbersign"); +grub_keymap_add_by_string("bar", "tilde"); +grub_keymap_add_by_string("backslash", "Atilde"); +grub_keymap_add_by_string("backslash", "Abackquote"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_QWERTZ(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("ampersand", "percent"); +grub_keymap_add_by_string("slash", "ampersand"); +grub_keymap_add_by_string("equal", "parenright"); +grub_keymap_add_by_string("question", "underscore"); +grub_keymap_add_by_string("backslash", "minus"); +grub_keymap_add_by_string("z", "y"); +grub_keymap_add_by_string("Z", "Y"); +grub_keymap_add_by_string("y", "z"); +grub_keymap_add_by_string("Y", "Z"); +grub_keymap_add_by_string("plus", "bracketright"); +grub_keymap_add_by_string("asterisk", "braceright"); +grub_keymap_add_by_string("semicolon", "less"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("caret", "backquote"); +grub_keymap_add_by_string("backquote", "equal"); +grub_keymap_add_by_string("numbersign", "backslash"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("percent", "caret"); +grub_keymap_add_by_string("less", "numbersign"); +grub_keymap_add_by_string("greater", "bar"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_QWERTZ_HUN(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("y", "z"); +grub_keymap_add_by_string("z", "y"); +grub_keymap_add_by_string("Y", "Z"); +grub_keymap_add_by_string("Z", "Y"); +grub_keymap_add_by_string("0", "backquote"); +grub_keymap_add_by_string("quote", "exclam"); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("plus", "numbersign"); +grub_keymap_add_by_string("exclam", "dollar"); +grub_keymap_add_by_string("slash", "caret"); +grub_keymap_add_by_string("equal", "ampersand"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("backslash", "Aq"); +grub_keymap_add_by_string("bar", "Aw"); +grub_keymap_add_by_string("bracketleft", "Af"); +grub_keymap_add_by_string("bracketright", "Ag"); +grub_keymap_add_by_string("greater", "Az"); +grub_keymap_add_by_string("numbersign", "Ax"); +grub_keymap_add_by_string("ampersand", "Ac"); +grub_keymap_add_by_string("at", "Av"); +grub_keymap_add_by_string("braceleft", "Ab"); +grub_keymap_add_by_string("braceright", "An"); +grub_keymap_add_by_string("less", "Am"); +grub_keymap_add_by_string("dollar", "colon"); +grub_keymap_add_by_string("question", "less"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("at", "doublequote"); +grub_keymap_add_by_string("tilde", "A1"); +grub_keymap_add_by_string("caret", "A3"); +grub_keymap_add_by_string("backquote", "A7"); +grub_keymap_add_by_string("asterisk", "0"); +grub_keymap_add_by_string("dollar", "Asemicolon"); +grub_keymap_add_by_string("semicolon", "Acomma"); +grub_keymap_add_by_string("greater", "Aperiod"); +grub_keymap_add_by_string("asterisk", "Aslash"); +grub_keymap_add_by_string("backquote", "A9"); +grub_keymap_add_by_string("doublequote", "A0"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_QWERTZ_SLOV_CROAT(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("quote", "minus"); +grub_keymap_add_by_string("plus", "equal"); +grub_keymap_add_by_string("y", "z"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("doublequote", "tilde"); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("ampersand", "caret"); +grub_keymap_add_by_string("slash", "ampersand"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("equal", "parenright"); +grub_keymap_add_by_string("question", "underscore"); +grub_keymap_add_by_string("asterisk", "plus"); +grub_keymap_add_by_string("Y", "Z"); +grub_keymap_add_by_string("semicolon", "less"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("tilde", "A1"); +grub_keymap_add_by_string("caret", "A3"); +grub_keymap_add_by_string("backquote", "A7"); +grub_keymap_add_by_string("backslash", "Aq"); +grub_keymap_add_by_string("bar", "Aw"); +grub_keymap_add_by_string("bracketleft", "Af"); +grub_keymap_add_by_string("bracketright", "Ag"); +grub_keymap_add_by_string("at", "Av"); +grub_keymap_add_by_string("braceleft", "Ab"); +grub_keymap_add_by_string("braceright", "An"); +grub_keymap_add_by_string("less", "Acomma"); +grub_keymap_add_by_string("greater", "Aperiod"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_SPANISH(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("slash", "ampersand"); +grub_keymap_add_by_string("ampersand", "caret"); +grub_keymap_add_by_string("caret", "braceleft"); +grub_keymap_add_by_string("asterisk", "braceright"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("equal", "parenright"); +grub_keymap_add_by_string("quote", "minus"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("question", "underscore"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("greater", "bar"); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("backslash", "backquote"); +grub_keymap_add_by_string("less", "backslash"); +grub_keymap_add_by_string("semicolon", "less"); +grub_keymap_add_by_string("backquote", "bracketleft"); +grub_keymap_add_by_string("plus", "bracketright"); +grub_keymap_add_by_string("plus", "colon"); +grub_keymap_add_by_string("at", "semicolon"); +grub_keymap_add_by_string("bar", "A1"); +grub_keymap_add_by_string("at", "A2"); +grub_keymap_add_by_string("numbersign", "A3"); +grub_keymap_add_by_string("tilde", "A4"); +grub_keymap_add_by_string("bracketleft", "Abracketleft"); +grub_keymap_add_by_string("bracketright", "Abracketright"); +grub_keymap_add_by_string("braceleft", "Aquote"); +grub_keymap_add_by_string("braceright", "Abackslash"); +grub_keymap_add_by_string("greater", "bar"); +grub_keymap_add_by_string("less", "backslash"); +grub_keymap_add_by_string("backslash", "Abackquote"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_SWEDISH(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("plus", "minus"); +grub_keymap_add_by_string("quote", "equal"); +grub_keymap_add_by_string("doublequote", "bracketright"); +grub_keymap_add_by_string("quote", "backslash"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("ampersand", "caret"); +grub_keymap_add_by_string("slash", "ampersand"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("equal", "parenright"); +grub_keymap_add_by_string("question", "underscore"); +grub_keymap_add_by_string("caret", "braceright"); +grub_keymap_add_by_string("asterisk", "bar"); +grub_keymap_add_by_string("backquote", "plus"); +grub_keymap_add_by_string("semicolon", "less"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("bar", "Atilde"); +grub_keymap_add_by_string("backslash", "Abackquote"); +grub_keymap_add_by_string("greater", "tilde"); +grub_keymap_add_by_string("at", "A2"); +grub_keymap_add_by_string("dollar", "A4"); +grub_keymap_add_by_string("braceleft", "A7"); +grub_keymap_add_by_string("bracketleft", "A8"); +grub_keymap_add_by_string("bracketright", "A9"); +grub_keymap_add_by_string("braceright", "A0"); +grub_keymap_add_by_string("backslash", "Aminus"); +grub_keymap_add_by_string("less", "quote"); +grub_keymap_add_by_string("greater", "doublequote"); +grub_keymap_add_by_string("tilde", "Abracketright"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_TURKISH_Q(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("doublequote", "backquote"); +grub_keymap_add_by_string("asterisk", "minus"); +grub_keymap_add_by_string("minus", "equal"); +grub_keymap_add_by_string("comma", "backslash"); +grub_keymap_add_by_string("period", "slash"); +grub_keymap_add_by_string("quote", "at"); +grub_keymap_add_by_string("caret", "numbersign"); +grub_keymap_add_by_string("plus", "dollar"); +grub_keymap_add_by_string("ampersand", "caret"); +grub_keymap_add_by_string("slash", "ampersand"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("equal", "parenright"); +grub_keymap_add_by_string("question", "underscore"); +grub_keymap_add_by_string("underscore", "plus"); +grub_keymap_add_by_string("semicolon", "bar"); +grub_keymap_add_by_string("colon", "question"); +grub_keymap_add_by_string("less", "Abackquote"); +grub_keymap_add_by_string("greater", "A1"); +grub_keymap_add_by_string("numbersign", "A3"); +grub_keymap_add_by_string("dollar", "A4"); +grub_keymap_add_by_string("braceleft", "A7"); +grub_keymap_add_by_string("bracketleft", "A8"); +grub_keymap_add_by_string("bracketright", "A9"); +grub_keymap_add_by_string("braceright", "A0"); +grub_keymap_add_by_string("backslash", "Aminus"); +grub_keymap_add_by_string("bar", "Aequal"); +grub_keymap_add_by_string("at", "Aq"); +grub_keymap_add_by_string("doublequote", "Abracketleft"); +grub_keymap_add_by_string("tilde", "Abracketright"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_VIETNAMESE(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("exclam", "A1"); +grub_keymap_add_by_string("at", "A2"); +grub_keymap_add_by_string("numbersign", "A3"); +grub_keymap_add_by_string("dollar", "A4"); +grub_keymap_add_by_string("percent", "A5"); +grub_keymap_add_by_string("caret", "A6"); +grub_keymap_add_by_string("ampersand", "A7"); +grub_keymap_add_by_string("asterisk", "A8"); +grub_keymap_add_by_string("parenleft", "A9"); +grub_keymap_add_by_string("parenright", "A0"); +grub_keymap_add_by_string("plus", "Aplus"); +grub_keymap_add_by_string("equal", "Aequal"); +grub_keymap_add_by_string("braceleft", "Abraceleft"); +grub_keymap_add_by_string("braceright", "Abraceright"); +grub_keymap_add_by_string("colon", "Acolon"); +grub_keymap_add_by_string("semicolon", "Asemicolon"); +grub_keymap_add_by_string("quote", "Aquote"); +grub_keymap_add_by_string("backslash", "Abackslash"); +grub_keymap_add_by_string("less", "Aless"); +grub_keymap_add_by_string("greater", "Agreater"); +grub_keymap_add_by_string("comma", "Acomma"); +grub_keymap_add_by_string("period", "Aperiod"); +grub_keymap_add_by_string("question", "Aquestion"); +grub_keymap_add_by_string("slash", "Aslash"); +grub_keymap_add_by_string("tilde", "Atilde"); +grub_keymap_add_by_string("backquote", "Abackquote"); +grub_keymap_add_by_string("bracketright", "Abracketright"); +grub_keymap_add_by_string("bracketleft", "Abracketleft"); +grub_keymap_add_by_string("bar", "Abar"); +grub_keymap_add_by_string("doublequote", "Adoublequote"); +grub_keymap_add_by_string("colon", "Acolon"); +grub_keymap_add_by_string("minus", "Aminus"); +grub_keymap_add_by_string("underscore", "Aunderscore"); +grub_keymap_enable(); +} +void ventoy_set_keyboard_layout(const char *layout); +void ventoy_set_keyboard_layout(const char *layout) { +ventoy_keyboard_set_layout(QWERTY_USA); +ventoy_keyboard_set_layout(AZERTY); +ventoy_keyboard_set_layout(CZECH_QWERTY); +ventoy_keyboard_set_layout(CZECH_QWERTZ); +ventoy_keyboard_set_layout(DANISH); +ventoy_keyboard_set_layout(DVORAK_USA); +ventoy_keyboard_set_layout(FRENCH); +ventoy_keyboard_set_layout(GERMAN); +ventoy_keyboard_set_layout(ITALIANO); +ventoy_keyboard_set_layout(JAPAN_106); +ventoy_keyboard_set_layout(LATIN_USA); +ventoy_keyboard_set_layout(PORTU_BRAZIL); +ventoy_keyboard_set_layout(QWERTY_UK); +ventoy_keyboard_set_layout(QWERTZ); +ventoy_keyboard_set_layout(QWERTZ_HUN); +ventoy_keyboard_set_layout(QWERTZ_SLOV_CROAT); +ventoy_keyboard_set_layout(SPANISH); +ventoy_keyboard_set_layout(SWEDISH); +ventoy_keyboard_set_layout(TURKISH_Q); +ventoy_keyboard_set_layout(VIETNAMESE); +} diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/term/setkey.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/term/setkey.c index 228df876..a0963529 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/term/setkey.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/term/setkey.c @@ -348,12 +348,38 @@ out: return grub_errno; } -static grub_extcmd_t cmd; +static void grub_keymap_add_by_string(const char *src, const char *dst) +{ + int in = 0; + int out = 0; + + in = parse_key(dst); + out = parse_key(src); + + if (in && out) + { + grub_keymap_add (in, out); + } +} + +#include "keyboard_layout.c" + +static grub_err_t grub_cmd_set_keylayout (grub_extcmd_context_t ctxt, int argc, char **args) +{ + (void)ctxt; + (void)argc; + ventoy_set_keyboard_layout(args[0]); + return 0; +} + +static grub_extcmd_t cmd, setcmd; GRUB_MOD_INIT(setkey) { cmd = grub_register_extcmd ("setkey", grub_cmd_setkey, 0, N_("NEW_KEY USA_KEY"), N_("Map default USA_KEY to NEW_KEY."), options); + setcmd = grub_register_extcmd ("set_keyboard_layout", grub_cmd_set_keylayout, 0, N_("layout"), + N_("Set keyboard layout."), NULL); } GRUB_MOD_FINI(setkey) diff --git a/INSTALL/grub/arm64-efi/command.lst b/INSTALL/grub/arm64-efi/command.lst index f7129270..23f101cd 100644 --- a/INSTALL/grub/arm64-efi/command.lst +++ b/INSTALL/grub/arm64-efi/command.lst @@ -32,6 +32,7 @@ *save_env: loadenv *search: search *serial: serial +*set_keyboard_layout: setkey *setkey: setkey *sha1sum: hashsum *sha256sum: hashsum diff --git a/INSTALL/grub/arm64-efi/moddep.lst b/INSTALL/grub/arm64-efi/moddep.lst index 1d83658e..b1814beb 100644 --- a/INSTALL/grub/arm64-efi/moddep.lst +++ b/INSTALL/grub/arm64-efi/moddep.lst @@ -1,7 +1,7 @@ videotest: font video gfxmenu -setkey: extcmd odc: archelp loopback: extcmd +setkey: extcmd macho: gcry_des: crypto memrw: extcmd diff --git a/INSTALL/grub/debug.cfg b/INSTALL/grub/debug.cfg index 07696031..dcd0a060 100644 --- a/INSTALL/grub/debug.cfg +++ b/INSTALL/grub/debug.cfg @@ -1,5 +1,5 @@ -source $prefix/keyboard.cfg.gz +source $prefix/keyboard.cfg submenu "Resolution Configuration" --class=debug_resolution { menuentry 'Return to previous menu [Esc]' --class=vtoyret VTOY_RET { diff --git a/INSTALL/grub/grub.cfg b/INSTALL/grub/grub.cfg index 673beb9b..783cfdad 100644 --- a/INSTALL/grub/grub.cfg +++ b/INSTALL/grub/grub.cfg @@ -1749,6 +1749,9 @@ else terminal_output gfxterm fi +if [ -n "$VTOY_DEFAULT_KBD_LAYOUT" ]; then + set_keyboard_layout "$VTOY_DEFAULT_KBD_LAYOUT" +fi if [ -n "$VTOY_PLUGIN_SYNTAX_ERROR" ]; then clear diff --git a/INSTALL/grub/i386-efi/command.lst b/INSTALL/grub/i386-efi/command.lst index 581aa0a7..18d5963b 100644 --- a/INSTALL/grub/i386-efi/command.lst +++ b/INSTALL/grub/i386-efi/command.lst @@ -43,6 +43,7 @@ *save_env: loadenv *search: search *serial: serial +*set_keyboard_layout: setkey *setkey: setkey *setpci: setpci *sha1sum: hashsum diff --git a/INSTALL/grub/i386-efi/moddep.lst b/INSTALL/grub/i386-efi/moddep.lst index 1afca1bb..bd5d77dd 100644 --- a/INSTALL/grub/i386-efi/moddep.lst +++ b/INSTALL/grub/i386-efi/moddep.lst @@ -1,7 +1,7 @@ videotest: font video gfxmenu -setkey: extcmd odc: archelp loopback: extcmd +setkey: extcmd macho: gcry_des: crypto memrw: extcmd diff --git a/INSTALL/grub/i386-pc/command.lst b/INSTALL/grub/i386-pc/command.lst index 7ee7afdf..fdc541a5 100644 --- a/INSTALL/grub/i386-pc/command.lst +++ b/INSTALL/grub/i386-pc/command.lst @@ -47,6 +47,7 @@ *search: search *sendkey: sendkey *serial: serial +*set_keyboard_layout: setkey *setkey: setkey *setpci: setpci *sha1sum: hashsum diff --git a/INSTALL/grub/i386-pc/moddep.lst b/INSTALL/grub/i386-pc/moddep.lst index 6218523c..9c4052a8 100644 --- a/INSTALL/grub/i386-pc/moddep.lst +++ b/INSTALL/grub/i386-pc/moddep.lst @@ -1,7 +1,7 @@ videotest: font video gfxmenu -setkey: extcmd odc: archelp loopback: extcmd +setkey: extcmd macho: gcry_des: crypto memrw: extcmd diff --git a/INSTALL/grub/keyboard.cfg b/INSTALL/grub/keyboard.cfg new file mode 100644 index 00000000..af3f4f29 --- /dev/null +++ b/INSTALL/grub/keyboard.cfg @@ -0,0 +1,62 @@ +submenu "Keyboard Layouts" --class=debug_krdlayout { + menuentry QWERTY_USA --class=debug_kbd { + set_keyboard_layout QWERTY_USA + } + menuentry AZERTY --class=debug_kbd { + set_keyboard_layout AZERTY + } + menuentry CZECH_QWERTY --class=debug_kbd { + set_keyboard_layout CZECH_QWERTY + } + menuentry CZECH_QWERTZ --class=debug_kbd { + set_keyboard_layout CZECH_QWERTZ + } + menuentry DANISH --class=debug_kbd { + set_keyboard_layout DANISH + } + menuentry DVORAK_USA --class=debug_kbd { + set_keyboard_layout DVORAK_USA + } + menuentry FRENCH --class=debug_kbd { + set_keyboard_layout FRENCH + } + menuentry GERMAN --class=debug_kbd { + set_keyboard_layout GERMAN + } + menuentry ITALIANO --class=debug_kbd { + set_keyboard_layout ITALIANO + } + menuentry JAPAN_106 --class=debug_kbd { + set_keyboard_layout JAPAN_106 + } + menuentry LATIN_USA --class=debug_kbd { + set_keyboard_layout LATIN_USA + } + menuentry PORTU_BRAZIL --class=debug_kbd { + set_keyboard_layout PORTU_BRAZIL + } + menuentry QWERTY_UK --class=debug_kbd { + set_keyboard_layout QWERTY_UK + } + menuentry QWERTZ --class=debug_kbd { + set_keyboard_layout QWERTZ + } + menuentry QWERTZ_HUN --class=debug_kbd { + set_keyboard_layout QWERTZ_HUN + } + menuentry QWERTZ_SLOV_CROAT --class=debug_kbd { + set_keyboard_layout QWERTZ_SLOV_CROAT + } + menuentry SPANISH --class=debug_kbd { + set_keyboard_layout SPANISH + } + menuentry SWEDISH --class=debug_kbd { + set_keyboard_layout SWEDISH + } + menuentry TURKISH_Q --class=debug_kbd { + set_keyboard_layout TURKISH_Q + } + menuentry VIETNAMESE --class=debug_kbd { + set_keyboard_layout VIETNAMESE + } +} diff --git a/INSTALL/grub/keyboard.cfg.gz b/INSTALL/grub/keyboard.cfg.gz deleted file mode 100644 index aaa08262291deff4132f97e71d1863bcff757523..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2416 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 delta 1581 zcmV+|2GaS^4A2aa903iH9UgxhDMq!JrFa>%^HdEJ@?eI=2xS4q$z*VNn#>7pAYfP= z%_2Zw!Jk&#NaQQ)AoKCyb2yX0y+${M#=>h@+cc653taKy?Q6~;f)wOa$&-2FETdf) z!dVStP~pMiV5Ni*SzViF#$r#DFrQi~y5-S4@6qV^7j~eu(O-T~vfh7`oEc58_Et_L z!-2uHh=h;ka#6C?f?Q@KZb->X@K1e<^Fm^Wcz1&IysSD{>}yz zC3u>K^mqe;s8Oq7$Xg;sxTzQgz4iTmsuwXjQS`mx+S4=Pe#~xQ7S>zlm*5+P*`kMu znCBGsDzx~wVffJ&Pi=o=H#<*KyMe_+R6cBynYZWT+keS`Q!Mah5BN|vz5rqnDjcPj z2&Uwu+-;2T8JG4sX?z@z6IZRgVUFKe6#7P=hM8kyS2-(_BPW-edB#z6`+!e?@>?0% zdXPdHfRXRh2i3e+LA+HoI9A9e-8up~he3f^gH)2PX3hL9 zAgVXYxfo=?RPwZ(vOq&*=Uvd)0>=qIN|_y^ppz?L->yt|h-}1p2V&p0&jYEvD*^EX zxxL|{e<)YEOGR)kI%)iO9z;ci3y36^!seuE5BEJ}i-LdZ@#IG0etM3#m6=mF%nP5I zp60M%!4`q3rD8Bdh+Fty^O>!tR0OHZmTpUR+6~T0yWjed!d-K1TZjum;g2~EePop# z{Q}X)w$y(Gab1yQn+Fp%5>IQ&P(WzLVX<6lPYFJbfokjwqBG!v zXkh;RLW!3I#I3fPbf*47+z|nT{6dj-qfsgdh}VDE5)S3Z%c}2U)TeT!X4h`qvfiV1 zXUy{yCUmQ#Q&=-z@M?qcx{QF;@>nO0U;YsjU1pw+33D`9Bd_488p`Vj$IVF$)3~nL zA;Sf0qQi=+`qoFhS0~X9DRKL-*sC1PVo}n5TQTHY4@p*H$OV$>c7UR~NO=^Ex-TZ5 zRsDa9iYC}vfwkn8)_eW5yS(MUDP#NS{_#{z#{Y1bU!F^B65f;KDmLLw_|(2l8xvIf z#=qF)NMbtt5%wA}ykbacf)|vrsj7}JeSNMX95Rsaj7=cN4tN>!9nVjJ>|xlj5BO7p<^eotILOh$?01Ew+*Ftb! zv4@s(h}6W56)$7*62d2Ww|UBqHhox7lv!@u{#Ya0CX1ANs5^GmBGDLj?;9XvOq+i$ zq;@&8rWfV825dIXI4UJ#7Q5oi_Xd;R!Q(LdypfTE`7KuYbQSUn|0|*Q@tK1zvsJDi zpsbVjAG89{vq|4!P!{VW3g1+4_Qlpkn1#n%6fwUX zRqYC%(yl2KPZRx6MA{-a{~2Szn#NEab+$@(iq+CEqMSTC6_aPlNbpvN=I)I+DMaX9 z;(j)U3iJf6J(z60VV15!!_{DY6GNb{rQb$KlZ}2O54L2+!MI`HcoYBt001EXg~4&p fP)XQi00F5Cm>>WEQT7jbvBYQl0ssI200dcDdO;L8 diff --git a/INSTALL/grub/x86_64-efi/command.lst b/INSTALL/grub/x86_64-efi/command.lst index ea082f5e..b9743610 100644 --- a/INSTALL/grub/x86_64-efi/command.lst +++ b/INSTALL/grub/x86_64-efi/command.lst @@ -43,6 +43,7 @@ *save_env: loadenv *search: search *serial: serial +*set_keyboard_layout: setkey *setkey: setkey *setpci: setpci *sha1sum: hashsum diff --git a/INSTALL/grub/x86_64-efi/moddep.lst b/INSTALL/grub/x86_64-efi/moddep.lst index c05dfc0f..ccdfd1e4 100644 --- a/INSTALL/grub/x86_64-efi/moddep.lst +++ b/INSTALL/grub/x86_64-efi/moddep.lst @@ -1,7 +1,7 @@ videotest: font video gfxmenu -setkey: extcmd odc: archelp loopback: extcmd +setkey: extcmd macho: gcry_des: crypto memrw: extcmd diff --git a/KBD/keyboard_layout.c b/KBD/keyboard_layout.c new file mode 100644 index 00000000..8d139b5f --- /dev/null +++ b/KBD/keyboard_layout.c @@ -0,0 +1,795 @@ + +#define ventoy_keyboard_set_layout(name) if (grub_strcmp(layout, #name) == 0) return ventoy_keyboard_layout_##name() + +static void ventoy_keyboard_layout_QWERTY_USA(void) { + grub_keymap_reset(); + grub_keymap_disable(); +} +static void ventoy_keyboard_layout_AZERTY(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("a", "q"); +grub_keymap_add_by_string("A", "Q"); +grub_keymap_add_by_string("z", "w"); +grub_keymap_add_by_string("Z", "W"); +grub_keymap_add_by_string("q", "a"); +grub_keymap_add_by_string("Q", "A"); +grub_keymap_add_by_string("m", "semicolon"); +grub_keymap_add_by_string("M", "colon"); +grub_keymap_add_by_string("w", "z"); +grub_keymap_add_by_string("W", "Z"); +grub_keymap_add_by_string("comma", "m"); +grub_keymap_add_by_string("question", "M"); +grub_keymap_add_by_string("semicolon", "comma"); +grub_keymap_add_by_string("period", "less"); +grub_keymap_add_by_string("colon", "period"); +grub_keymap_add_by_string("slash", "greater"); +grub_keymap_add_by_string("exclam", "slash"); +grub_keymap_add_by_string("dollar", "bracketright"); +grub_keymap_add_by_string("asterisk", "backslash"); +grub_keymap_add_by_string("percent", "doublequote"); +grub_keymap_add_by_string("ampersand", "1"); +grub_keymap_add_by_string("1", "exclam"); +grub_keymap_add_by_string("tilde", "2"); +grub_keymap_add_by_string("2", "at"); +grub_keymap_add_by_string("doublequote", "3"); +grub_keymap_add_by_string("3", "numbersign"); +grub_keymap_add_by_string("quote", "4"); +grub_keymap_add_by_string("4", "dollar"); +grub_keymap_add_by_string("parenleft", "5"); +grub_keymap_add_by_string("5", "percent"); +grub_keymap_add_by_string("minus", "6"); +grub_keymap_add_by_string("6", "caret"); +grub_keymap_add_by_string("backquote", "7"); +grub_keymap_add_by_string("7", "ampersand"); +grub_keymap_add_by_string("underscore", "8"); +grub_keymap_add_by_string("8", "asterisk"); +grub_keymap_add_by_string("caret", "9"); +grub_keymap_add_by_string("9", "parenleft"); +grub_keymap_add_by_string("at", "0"); +grub_keymap_add_by_string("0", "parenright"); +grub_keymap_add_by_string("parenright", "minus"); +grub_keymap_add_by_string("less", "backquote"); +grub_keymap_add_by_string("greater", "tilde"); +grub_keymap_add_by_string("numbersign", "braceright"); +grub_keymap_add_by_string("backslash", "question"); +grub_keymap_add_by_string("bracketright", "braceleft"); +grub_keymap_add_by_string("braceleft", "quote"); +grub_keymap_add_by_string("braceright", "underscore"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_CZECH_QWERTY(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("semicolon", "backquote"); +grub_keymap_add_by_string("plus", "1"); +grub_keymap_add_by_string("equal", "minus"); +grub_keymap_add_by_string("quote", "equal"); +grub_keymap_add_by_string("parenright", "bracketright"); +grub_keymap_add_by_string("doublequote", "backslash"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("1", "exclam"); +grub_keymap_add_by_string("2", "at"); +grub_keymap_add_by_string("3", "numbersign"); +grub_keymap_add_by_string("4", "dollar"); +grub_keymap_add_by_string("5", "percent"); +grub_keymap_add_by_string("6", "caret"); +grub_keymap_add_by_string("7", "ampersand"); +grub_keymap_add_by_string("8", "asterisk"); +grub_keymap_add_by_string("9", "parenleft"); +grub_keymap_add_by_string("0", "parenright"); +grub_keymap_add_by_string("percent", "underscore"); +grub_keymap_add_by_string("slash", "braceleft"); +grub_keymap_add_by_string("parenleft", "braceright"); +grub_keymap_add_by_string("doublequote", "colon"); +grub_keymap_add_by_string("exclam", "doublequote"); +grub_keymap_add_by_string("quote", "bar"); +grub_keymap_add_by_string("question", "less"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("backquote", "Abackquote"); +grub_keymap_add_by_string("exclam", "A1"); +grub_keymap_add_by_string("at", "A2"); +grub_keymap_add_by_string("numbersign", "A3"); +grub_keymap_add_by_string("dollar", "A4"); +grub_keymap_add_by_string("percent", "A5"); +grub_keymap_add_by_string("caret", "A6"); +grub_keymap_add_by_string("ampersand", "A7"); +grub_keymap_add_by_string("asterisk", "A8"); +grub_keymap_add_by_string("parenleft", "A9"); +grub_keymap_add_by_string("parenright", "A0"); +grub_keymap_add_by_string("minus", "Aminus"); +grub_keymap_add_by_string("equal", "Aequal"); +grub_keymap_add_by_string("bracketleft", "Abracketleft"); +grub_keymap_add_by_string("bracketright", "Abracketright"); +grub_keymap_add_by_string("semicolon", "Asemicolon"); +grub_keymap_add_by_string("backslash", "Abackslash"); +grub_keymap_add_by_string("less", "Acomma"); +grub_keymap_add_by_string("greater", "Aperiod"); +grub_keymap_add_by_string("slash", "Aslash"); +grub_keymap_add_by_string("tilde", "Atilde"); +grub_keymap_add_by_string("underscore", "Aunderscore"); +grub_keymap_add_by_string("plus", "Aplus"); +grub_keymap_add_by_string("braceleft", "Abraceleft"); +grub_keymap_add_by_string("braceright", "Abraceright"); +grub_keymap_add_by_string("caret", "Adoublequote"); +grub_keymap_add_by_string("colon", "Acolon"); +grub_keymap_add_by_string("question", "Aquestion"); +grub_keymap_add_by_string("bar", "Abar"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_CZECH_QWERTZ(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("y", "z"); +grub_keymap_add_by_string("z", "y"); +grub_keymap_add_by_string("Y", "Z"); +grub_keymap_add_by_string("Z", "Y"); +grub_keymap_add_by_string("semicolon", "backquote"); +grub_keymap_add_by_string("plus", "1"); +grub_keymap_add_by_string("equal", "minus"); +grub_keymap_add_by_string("quote", "equal"); +grub_keymap_add_by_string("parenright", "bracketright"); +grub_keymap_add_by_string("doublequote", "backslash"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("1", "exclam"); +grub_keymap_add_by_string("2", "at"); +grub_keymap_add_by_string("3", "numbersign"); +grub_keymap_add_by_string("4", "dollar"); +grub_keymap_add_by_string("5", "percent"); +grub_keymap_add_by_string("6", "caret"); +grub_keymap_add_by_string("7", "ampersand"); +grub_keymap_add_by_string("8", "asterisk"); +grub_keymap_add_by_string("9", "parenleft"); +grub_keymap_add_by_string("0", "parenright"); +grub_keymap_add_by_string("percent", "underscore"); +grub_keymap_add_by_string("slash", "braceleft"); +grub_keymap_add_by_string("parenleft", "braceright"); +grub_keymap_add_by_string("doublequote", "colon"); +grub_keymap_add_by_string("exclam", "doublequote"); +grub_keymap_add_by_string("quote", "bar"); +grub_keymap_add_by_string("question", "less"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("tilde", "A1"); +grub_keymap_add_by_string("caret", "A3"); +grub_keymap_add_by_string("backslash", "Aq"); +grub_keymap_add_by_string("bar", "Aw"); +grub_keymap_add_by_string("bracketleft", "Af"); +grub_keymap_add_by_string("bracketright", "Ag"); +grub_keymap_add_by_string("dollar", "Asemicolon"); +grub_keymap_add_by_string("numbersign", "Ax"); +grub_keymap_add_by_string("ampersand", "Ac"); +grub_keymap_add_by_string("at", "Av"); +grub_keymap_add_by_string("braceleft", "Ab"); +grub_keymap_add_by_string("braceright", "An"); +grub_keymap_add_by_string("less", "Acomma"); +grub_keymap_add_by_string("greater", "Aperiod"); +grub_keymap_add_by_string("asterisk", "Aslash"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_DANISH(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("plus", "minus"); +grub_keymap_add_by_string("quote", "equal"); +grub_keymap_add_by_string("doublequote", "bracketright"); +grub_keymap_add_by_string("quote", "backslash"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("ampersand", "caret"); +grub_keymap_add_by_string("slash", "ampersand"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("equal", "parenright"); +grub_keymap_add_by_string("question", "underscore"); +grub_keymap_add_by_string("caret", "braceright"); +grub_keymap_add_by_string("asterisk", "bar"); +grub_keymap_add_by_string("backquote", "plus"); +grub_keymap_add_by_string("semicolon", "less"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("bar", "Atilde"); +grub_keymap_add_by_string("backslash", "Abackquote"); +grub_keymap_add_by_string("greater", "tilde"); +grub_keymap_add_by_string("at", "A2"); +grub_keymap_add_by_string("dollar", "A4"); +grub_keymap_add_by_string("braceleft", "A7"); +grub_keymap_add_by_string("bracketleft", "A8"); +grub_keymap_add_by_string("bracketright", "A9"); +grub_keymap_add_by_string("braceright", "A0"); +grub_keymap_add_by_string("backslash", "Aminus"); +grub_keymap_add_by_string("less", "quote"); +grub_keymap_add_by_string("greater", "doublequote"); +grub_keymap_add_by_string("tilde", "Abracketright"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_DVORAK_USA(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("[", "minus"); +grub_keymap_add_by_string("braceleft", "underscore"); +grub_keymap_add_by_string("quote", "q"); +grub_keymap_add_by_string("doublequote", "Q"); +grub_keymap_add_by_string("comma", "w"); +grub_keymap_add_by_string("less", "W"); +grub_keymap_add_by_string("s", "semicolon"); +grub_keymap_add_by_string("S", "colon"); +grub_keymap_add_by_string("semicolon", "z"); +grub_keymap_add_by_string("colon", "Z"); +grub_keymap_add_by_string("w", "comma"); +grub_keymap_add_by_string("W", "less"); +grub_keymap_add_by_string("v", "period"); +grub_keymap_add_by_string("z", "greater"); +grub_keymap_add_by_string("z", "slash"); +grub_keymap_add_by_string("equal", "bracketright"); +grub_keymap_add_by_string("backslash", "backslash"); +grub_keymap_add_by_string("underscore", "doublequote"); +grub_keymap_add_by_string("quote", "q"); +grub_keymap_add_by_string("doublequote", "Q"); +grub_keymap_add_by_string("comma", "w"); +grub_keymap_add_by_string("less", "W"); +grub_keymap_add_by_string("period", "e"); +grub_keymap_add_by_string("greater", "E"); +grub_keymap_add_by_string("p", "r"); +grub_keymap_add_by_string("P", "R"); +grub_keymap_add_by_string("y", "t"); +grub_keymap_add_by_string("Y", "T"); +grub_keymap_add_by_string("f", "y"); +grub_keymap_add_by_string("F", "Y"); +grub_keymap_add_by_string("g", "u"); +grub_keymap_add_by_string("G", "U"); +grub_keymap_add_by_string("c", "c"); +grub_keymap_add_by_string("C", "I"); +grub_keymap_add_by_string("r", "o"); +grub_keymap_add_by_string("R", "O"); +grub_keymap_add_by_string("l", "p"); +grub_keymap_add_by_string("L", "P"); +grub_keymap_add_by_string("bracketright", "equal"); +grub_keymap_add_by_string("braceright", "plus"); +grub_keymap_add_by_string("a", "a"); +grub_keymap_add_by_string("A", "A"); +grub_keymap_add_by_string("o", "s"); +grub_keymap_add_by_string("O", "S"); +grub_keymap_add_by_string("e", "d"); +grub_keymap_add_by_string("E", "D"); +grub_keymap_add_by_string("u", "f"); +grub_keymap_add_by_string("U", "F"); +grub_keymap_add_by_string("i", "g"); +grub_keymap_add_by_string("I", "G"); +grub_keymap_add_by_string("d", "h"); +grub_keymap_add_by_string("D", "H"); +grub_keymap_add_by_string("h", "j"); +grub_keymap_add_by_string("H", "J"); +grub_keymap_add_by_string("t", "k"); +grub_keymap_add_by_string("T", "K"); +grub_keymap_add_by_string("n", "l"); +grub_keymap_add_by_string("N", "L"); +grub_keymap_add_by_string("s", "semicolon"); +grub_keymap_add_by_string("S", "colon"); +grub_keymap_add_by_string("minus", "quote"); +grub_keymap_add_by_string("underscore", "doublequote"); +grub_keymap_add_by_string("semicolon", "z"); +grub_keymap_add_by_string("colon", "Z"); +grub_keymap_add_by_string("q", "x"); +grub_keymap_add_by_string("Q", "X"); +grub_keymap_add_by_string("j", "c"); +grub_keymap_add_by_string("J", "C"); +grub_keymap_add_by_string("k", "v"); +grub_keymap_add_by_string("K", "V"); +grub_keymap_add_by_string("x", "b"); +grub_keymap_add_by_string("X", "B"); +grub_keymap_add_by_string("b", "n"); +grub_keymap_add_by_string("B", "N"); +grub_keymap_add_by_string("w", "comma"); +grub_keymap_add_by_string("W", "less"); +grub_keymap_add_by_string("v", "period"); +grub_keymap_add_by_string("V", "greater"); +grub_keymap_add_by_string("z", "slash"); +grub_keymap_add_by_string("Z", "question"); +grub_keymap_add_by_string("slash", "bracketleft"); +grub_keymap_add_by_string("question", "braceleft"); +grub_keymap_add_by_string("equal", "bracketright"); +grub_keymap_add_by_string("plus", "braceright"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_FRENCH(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("less", "backquote"); +grub_keymap_add_by_string("greater", "tilde"); +grub_keymap_add_by_string("ampersand", "1"); +grub_keymap_add_by_string("1", "exclam"); +grub_keymap_add_by_string("tilde", "2"); +grub_keymap_add_by_string("2", "at"); +grub_keymap_add_by_string("doublequote", "3"); +grub_keymap_add_by_string("3", "numbersign"); +grub_keymap_add_by_string("quote", "4"); +grub_keymap_add_by_string("4", "dollar"); +grub_keymap_add_by_string("parenleft", "5"); +grub_keymap_add_by_string("5", "percent"); +grub_keymap_add_by_string("minus", "6"); +grub_keymap_add_by_string("6", "caret"); +grub_keymap_add_by_string("backquote", "7"); +grub_keymap_add_by_string("7", "ampersand"); +grub_keymap_add_by_string("underscore", "8"); +grub_keymap_add_by_string("8", "asterisk"); +grub_keymap_add_by_string("backslash", "9"); +grub_keymap_add_by_string("9", "parenleft"); +grub_keymap_add_by_string("at", "0"); +grub_keymap_add_by_string("0", "parenright"); +grub_keymap_add_by_string("parenright", "minus"); +grub_keymap_add_by_string("numbersign", "underscore"); +grub_keymap_add_by_string("a", "q"); +grub_keymap_add_by_string("A", "Q"); +grub_keymap_add_by_string("z", "w"); +grub_keymap_add_by_string("Z", "W"); +grub_keymap_add_by_string("caret", "bracketleft"); +grub_keymap_add_by_string("dollar", "bracketright"); +grub_keymap_add_by_string("q", "a"); +grub_keymap_add_by_string("Q", "A"); +grub_keymap_add_by_string("m", "semicolon"); +grub_keymap_add_by_string("M", "colon"); +grub_keymap_add_by_string("bracketleft", "quote"); +grub_keymap_add_by_string("percent", "doublequote"); +grub_keymap_add_by_string("asterisk", "backslash"); +grub_keymap_add_by_string("bracketright", "bar"); +grub_keymap_add_by_string("w", "z"); +grub_keymap_add_by_string("W", "Z"); +grub_keymap_add_by_string("comma", "m"); +grub_keymap_add_by_string("question", "M"); +grub_keymap_add_by_string("semicolon", "comma"); +grub_keymap_add_by_string("period", "less"); +grub_keymap_add_by_string("colon", "period"); +grub_keymap_add_by_string("slash", "greater"); +grub_keymap_add_by_string("exclam", "slash"); +grub_keymap_add_by_string("bar", "question"); +grub_keymap_add_by_string("tilde", "A2"); +grub_keymap_add_by_string("numbersign", "A3"); +grub_keymap_add_by_string("braceleft", "A4"); +grub_keymap_add_by_string("bracketleft", "A5"); +grub_keymap_add_by_string("bar", "A6"); +grub_keymap_add_by_string("quote", "A7"); +grub_keymap_add_by_string("backslash", "A8"); +grub_keymap_add_by_string("caret", "A9"); +grub_keymap_add_by_string("at", "A0"); +grub_keymap_add_by_string("bracketright", "Aminus"); +grub_keymap_add_by_string("braceright", "Aequal"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_GERMAN(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("ampersand", "caret"); +grub_keymap_add_by_string("slash", "ampersand"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("equal", "parenright"); +grub_keymap_add_by_string("question", "underscore"); +grub_keymap_add_by_string("backslash", "minus"); +grub_keymap_add_by_string("z", "y"); +grub_keymap_add_by_string("Z", "Y"); +grub_keymap_add_by_string("y", "z"); +grub_keymap_add_by_string("Y", "Z"); +grub_keymap_add_by_string("plus", "bracketright"); +grub_keymap_add_by_string("asterisk", "braceright"); +grub_keymap_add_by_string("semicolon", "less"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("backslash", "Aminus"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("caret", "backquote"); +grub_keymap_add_by_string("quote", "equal"); +grub_keymap_add_by_string("backquote", "plus"); +grub_keymap_add_by_string("braceright", "doublequote"); +grub_keymap_add_by_string("bar", "bracketleft"); +grub_keymap_add_by_string("at", "braceleft"); +grub_keymap_add_by_string("numbersign", "backslash"); +grub_keymap_add_by_string("at", "Aq"); +grub_keymap_add_by_string("less", "backquote"); +grub_keymap_add_by_string("greater", "tilde"); +grub_keymap_add_by_string("braceleft", "A7"); +grub_keymap_add_by_string("bracketleft", "A8"); +grub_keymap_add_by_string("bracketright", "A9"); +grub_keymap_add_by_string("braceright", "A0"); +grub_keymap_add_by_string("tilde", "Abracketright"); +grub_keymap_add_by_string("backslash", "Aminus"); +grub_keymap_add_by_string("quote", "bar"); +grub_keymap_add_by_string("greater", "semicolon"); +grub_keymap_add_by_string("less", "colon"); +grub_keymap_add_by_string("bar", "quote"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_ITALIANO(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("backslash", "backquote"); +grub_keymap_add_by_string("bar", "tilde"); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("tilde", "numbersign"); +grub_keymap_add_by_string("ampersand", "caret"); +grub_keymap_add_by_string("slash", "ampersand"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("equal", "parenright"); +grub_keymap_add_by_string("quote", "minus"); +grub_keymap_add_by_string("question", "underscore"); +grub_keymap_add_by_string("caret", "plus"); +grub_keymap_add_by_string("bracketleft", "bracketleft"); +grub_keymap_add_by_string("bracketright", "braceleft"); +grub_keymap_add_by_string("plus", "bracketright"); +grub_keymap_add_by_string("asterisk", "braceright"); +grub_keymap_add_by_string("at", "semicolon"); +grub_keymap_add_by_string("braceleft", "colon"); +grub_keymap_add_by_string("numbersign", "quote"); +grub_keymap_add_by_string("braceright", "doublequote"); +grub_keymap_add_by_string("less", "backslash"); +grub_keymap_add_by_string("greater", "bar"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("semicolon", "less"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("bracketleft", "Abracketleft"); +grub_keymap_add_by_string("bracketright", "Abracketright"); +grub_keymap_add_by_string("at", "Asemicolon"); +grub_keymap_add_by_string("numbersign", "Aquote"); +grub_keymap_add_by_string("braceright", "Abraceright"); +grub_keymap_add_by_string("braceleft", "Abraceleft"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_JAPAN_106(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("at", "bracketleft"); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("ampersand", "caret"); +grub_keymap_add_by_string("quote", "ampersand"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("underscore", "parenright"); +grub_keymap_add_by_string("equal", "underscore"); +grub_keymap_add_by_string("plus", "colon"); +grub_keymap_add_by_string("colon", "quote"); +grub_keymap_add_by_string("asterisk", "doublequote"); +grub_keymap_add_by_string("bracketleft", "bracketright"); +grub_keymap_add_by_string("braceleft", "braceright"); +grub_keymap_add_by_string("bracketright", "backslash"); +grub_keymap_add_by_string("braceright", "bar"); +grub_keymap_add_by_string("backslash", "backquote"); +grub_keymap_add_by_string("tilde", "plus"); +grub_keymap_add_by_string("caret", "equal"); +grub_keymap_add_by_string("backquote", "braceleft"); +grub_keymap_add_by_string("bar", "tilde"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_LATIN_USA(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("bar", "backquote"); +grub_keymap_add_by_string("quote", "minus"); +grub_keymap_add_by_string("question", "underscore"); +grub_keymap_add_by_string("backquote", "bracketleft"); +grub_keymap_add_by_string("plus", "bracketright"); +grub_keymap_add_by_string("braceleft", "quote"); +grub_keymap_add_by_string("braceright", "backslash"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("ampersand", "caret"); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("slash", "ampersand"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("equal", "parenright"); +grub_keymap_add_by_string("asterisk", "braceright"); +grub_keymap_add_by_string("bracketleft", "doublequote"); +grub_keymap_add_by_string("bracketright", "bar"); +grub_keymap_add_by_string("semicolon", "less"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("caret", "Aquote"); +grub_keymap_add_by_string("doublequote", "braceleft"); +grub_keymap_add_by_string("at", "Aq"); +grub_keymap_add_by_string("backquote", "Abackslash"); +grub_keymap_add_by_string("backslash", "Aminus"); +grub_keymap_add_by_string("greater", "plus"); +grub_keymap_add_by_string("less", "equal"); +grub_keymap_add_by_string("backslash", "Aminus"); +grub_keymap_add_by_string("backquote", "Abackslash"); +grub_keymap_add_by_string("tilde", "Abracketright"); +grub_keymap_add_by_string("caret", "Aquote"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_PORTU_BRAZIL(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("quote", "backquote"); +grub_keymap_add_by_string("quote", "bracketleft"); +grub_keymap_add_by_string("bracketleft", "bracketright"); +grub_keymap_add_by_string("tilde", "quote"); +grub_keymap_add_by_string("bracketright", "backslash"); +grub_keymap_add_by_string("semicolon", "slash"); +grub_keymap_add_by_string("bar", "colon"); +grub_keymap_add_by_string("doublequote", "tilde"); +grub_keymap_add_by_string("backquote", "braceleft"); +grub_keymap_add_by_string("braceleft", "braceright"); +grub_keymap_add_by_string("caret", "doublequote"); +grub_keymap_add_by_string("braceright", "bar"); +grub_keymap_add_by_string("colon", "question"); +grub_keymap_add_by_string("backslash", "semicolon"); +grub_keymap_add_by_string("bar", "Atilde"); +grub_keymap_add_by_string("backslash", "Abackquote"); +grub_keymap_add_by_string("slash", "Aq"); +grub_keymap_add_by_string("question", "Aw"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_QWERTY_UK(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("at", "doublequote"); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("tilde", "bar"); +grub_keymap_add_by_string("numbersign", "backslash"); +grub_keymap_add_by_string("backslash", "numbersign"); +grub_keymap_add_by_string("bar", "tilde"); +grub_keymap_add_by_string("backslash", "Atilde"); +grub_keymap_add_by_string("backslash", "Abackquote"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_QWERTZ(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("ampersand", "percent"); +grub_keymap_add_by_string("slash", "ampersand"); +grub_keymap_add_by_string("equal", "parenright"); +grub_keymap_add_by_string("question", "underscore"); +grub_keymap_add_by_string("backslash", "minus"); +grub_keymap_add_by_string("z", "y"); +grub_keymap_add_by_string("Z", "Y"); +grub_keymap_add_by_string("y", "z"); +grub_keymap_add_by_string("Y", "Z"); +grub_keymap_add_by_string("plus", "bracketright"); +grub_keymap_add_by_string("asterisk", "braceright"); +grub_keymap_add_by_string("semicolon", "less"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("caret", "backquote"); +grub_keymap_add_by_string("backquote", "equal"); +grub_keymap_add_by_string("numbersign", "backslash"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("percent", "caret"); +grub_keymap_add_by_string("less", "numbersign"); +grub_keymap_add_by_string("greater", "bar"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_QWERTZ_HUN(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("y", "z"); +grub_keymap_add_by_string("z", "y"); +grub_keymap_add_by_string("Y", "Z"); +grub_keymap_add_by_string("Z", "Y"); +grub_keymap_add_by_string("0", "backquote"); +grub_keymap_add_by_string("quote", "exclam"); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("plus", "numbersign"); +grub_keymap_add_by_string("exclam", "dollar"); +grub_keymap_add_by_string("slash", "caret"); +grub_keymap_add_by_string("equal", "ampersand"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("backslash", "Aq"); +grub_keymap_add_by_string("bar", "Aw"); +grub_keymap_add_by_string("bracketleft", "Af"); +grub_keymap_add_by_string("bracketright", "Ag"); +grub_keymap_add_by_string("greater", "Az"); +grub_keymap_add_by_string("numbersign", "Ax"); +grub_keymap_add_by_string("ampersand", "Ac"); +grub_keymap_add_by_string("at", "Av"); +grub_keymap_add_by_string("braceleft", "Ab"); +grub_keymap_add_by_string("braceright", "An"); +grub_keymap_add_by_string("less", "Am"); +grub_keymap_add_by_string("dollar", "colon"); +grub_keymap_add_by_string("question", "less"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("at", "doublequote"); +grub_keymap_add_by_string("tilde", "A1"); +grub_keymap_add_by_string("caret", "A3"); +grub_keymap_add_by_string("backquote", "A7"); +grub_keymap_add_by_string("asterisk", "0"); +grub_keymap_add_by_string("dollar", "Asemicolon"); +grub_keymap_add_by_string("semicolon", "Acomma"); +grub_keymap_add_by_string("greater", "Aperiod"); +grub_keymap_add_by_string("asterisk", "Aslash"); +grub_keymap_add_by_string("backquote", "A9"); +grub_keymap_add_by_string("doublequote", "A0"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_QWERTZ_SLOV_CROAT(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("quote", "minus"); +grub_keymap_add_by_string("plus", "equal"); +grub_keymap_add_by_string("y", "z"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("doublequote", "tilde"); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("ampersand", "caret"); +grub_keymap_add_by_string("slash", "ampersand"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("equal", "parenright"); +grub_keymap_add_by_string("question", "underscore"); +grub_keymap_add_by_string("asterisk", "plus"); +grub_keymap_add_by_string("Y", "Z"); +grub_keymap_add_by_string("semicolon", "less"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("tilde", "A1"); +grub_keymap_add_by_string("caret", "A3"); +grub_keymap_add_by_string("backquote", "A7"); +grub_keymap_add_by_string("backslash", "Aq"); +grub_keymap_add_by_string("bar", "Aw"); +grub_keymap_add_by_string("bracketleft", "Af"); +grub_keymap_add_by_string("bracketright", "Ag"); +grub_keymap_add_by_string("at", "Av"); +grub_keymap_add_by_string("braceleft", "Ab"); +grub_keymap_add_by_string("braceright", "An"); +grub_keymap_add_by_string("less", "Acomma"); +grub_keymap_add_by_string("greater", "Aperiod"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_SPANISH(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("slash", "ampersand"); +grub_keymap_add_by_string("ampersand", "caret"); +grub_keymap_add_by_string("caret", "braceleft"); +grub_keymap_add_by_string("asterisk", "braceright"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("equal", "parenright"); +grub_keymap_add_by_string("quote", "minus"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("question", "underscore"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("greater", "bar"); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("backslash", "backquote"); +grub_keymap_add_by_string("less", "backslash"); +grub_keymap_add_by_string("semicolon", "less"); +grub_keymap_add_by_string("backquote", "bracketleft"); +grub_keymap_add_by_string("plus", "bracketright"); +grub_keymap_add_by_string("plus", "colon"); +grub_keymap_add_by_string("at", "semicolon"); +grub_keymap_add_by_string("bar", "A1"); +grub_keymap_add_by_string("at", "A2"); +grub_keymap_add_by_string("numbersign", "A3"); +grub_keymap_add_by_string("tilde", "A4"); +grub_keymap_add_by_string("bracketleft", "Abracketleft"); +grub_keymap_add_by_string("bracketright", "Abracketright"); +grub_keymap_add_by_string("braceleft", "Aquote"); +grub_keymap_add_by_string("braceright", "Abackslash"); +grub_keymap_add_by_string("greater", "bar"); +grub_keymap_add_by_string("less", "backslash"); +grub_keymap_add_by_string("backslash", "Abackquote"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_SWEDISH(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("plus", "minus"); +grub_keymap_add_by_string("quote", "equal"); +grub_keymap_add_by_string("doublequote", "bracketright"); +grub_keymap_add_by_string("quote", "backslash"); +grub_keymap_add_by_string("minus", "slash"); +grub_keymap_add_by_string("doublequote", "at"); +grub_keymap_add_by_string("ampersand", "caret"); +grub_keymap_add_by_string("slash", "ampersand"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("equal", "parenright"); +grub_keymap_add_by_string("question", "underscore"); +grub_keymap_add_by_string("caret", "braceright"); +grub_keymap_add_by_string("asterisk", "bar"); +grub_keymap_add_by_string("backquote", "plus"); +grub_keymap_add_by_string("semicolon", "less"); +grub_keymap_add_by_string("colon", "greater"); +grub_keymap_add_by_string("underscore", "question"); +grub_keymap_add_by_string("bar", "Atilde"); +grub_keymap_add_by_string("backslash", "Abackquote"); +grub_keymap_add_by_string("greater", "tilde"); +grub_keymap_add_by_string("at", "A2"); +grub_keymap_add_by_string("dollar", "A4"); +grub_keymap_add_by_string("braceleft", "A7"); +grub_keymap_add_by_string("bracketleft", "A8"); +grub_keymap_add_by_string("bracketright", "A9"); +grub_keymap_add_by_string("braceright", "A0"); +grub_keymap_add_by_string("backslash", "Aminus"); +grub_keymap_add_by_string("less", "quote"); +grub_keymap_add_by_string("greater", "doublequote"); +grub_keymap_add_by_string("tilde", "Abracketright"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_TURKISH_Q(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("doublequote", "backquote"); +grub_keymap_add_by_string("asterisk", "minus"); +grub_keymap_add_by_string("minus", "equal"); +grub_keymap_add_by_string("comma", "backslash"); +grub_keymap_add_by_string("period", "slash"); +grub_keymap_add_by_string("quote", "at"); +grub_keymap_add_by_string("caret", "numbersign"); +grub_keymap_add_by_string("plus", "dollar"); +grub_keymap_add_by_string("ampersand", "caret"); +grub_keymap_add_by_string("slash", "ampersand"); +grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenright", "parenleft"); +grub_keymap_add_by_string("equal", "parenright"); +grub_keymap_add_by_string("question", "underscore"); +grub_keymap_add_by_string("underscore", "plus"); +grub_keymap_add_by_string("semicolon", "bar"); +grub_keymap_add_by_string("colon", "question"); +grub_keymap_add_by_string("less", "Abackquote"); +grub_keymap_add_by_string("greater", "A1"); +grub_keymap_add_by_string("numbersign", "A3"); +grub_keymap_add_by_string("dollar", "A4"); +grub_keymap_add_by_string("braceleft", "A7"); +grub_keymap_add_by_string("bracketleft", "A8"); +grub_keymap_add_by_string("bracketright", "A9"); +grub_keymap_add_by_string("braceright", "A0"); +grub_keymap_add_by_string("backslash", "Aminus"); +grub_keymap_add_by_string("bar", "Aequal"); +grub_keymap_add_by_string("at", "Aq"); +grub_keymap_add_by_string("doublequote", "Abracketleft"); +grub_keymap_add_by_string("tilde", "Abracketright"); +grub_keymap_enable(); +} +static void ventoy_keyboard_layout_VIETNAMESE(void) { +grub_keymap_reset(); +grub_keymap_add_by_string("exclam", "A1"); +grub_keymap_add_by_string("at", "A2"); +grub_keymap_add_by_string("numbersign", "A3"); +grub_keymap_add_by_string("dollar", "A4"); +grub_keymap_add_by_string("percent", "A5"); +grub_keymap_add_by_string("caret", "A6"); +grub_keymap_add_by_string("ampersand", "A7"); +grub_keymap_add_by_string("asterisk", "A8"); +grub_keymap_add_by_string("parenleft", "A9"); +grub_keymap_add_by_string("parenright", "A0"); +grub_keymap_add_by_string("plus", "Aplus"); +grub_keymap_add_by_string("equal", "Aequal"); +grub_keymap_add_by_string("braceleft", "Abraceleft"); +grub_keymap_add_by_string("braceright", "Abraceright"); +grub_keymap_add_by_string("colon", "Acolon"); +grub_keymap_add_by_string("semicolon", "Asemicolon"); +grub_keymap_add_by_string("quote", "Aquote"); +grub_keymap_add_by_string("backslash", "Abackslash"); +grub_keymap_add_by_string("less", "Aless"); +grub_keymap_add_by_string("greater", "Agreater"); +grub_keymap_add_by_string("comma", "Acomma"); +grub_keymap_add_by_string("period", "Aperiod"); +grub_keymap_add_by_string("question", "Aquestion"); +grub_keymap_add_by_string("slash", "Aslash"); +grub_keymap_add_by_string("tilde", "Atilde"); +grub_keymap_add_by_string("backquote", "Abackquote"); +grub_keymap_add_by_string("bracketright", "Abracketright"); +grub_keymap_add_by_string("bracketleft", "Abracketleft"); +grub_keymap_add_by_string("bar", "Abar"); +grub_keymap_add_by_string("doublequote", "Adoublequote"); +grub_keymap_add_by_string("colon", "Acolon"); +grub_keymap_add_by_string("minus", "Aminus"); +grub_keymap_add_by_string("underscore", "Aunderscore"); +grub_keymap_enable(); +} +void ventoy_set_keyboard_layout(const char *layout); +void ventoy_set_keyboard_layout(const char *layout) { +ventoy_keyboard_set_layout(QWERTY_USA); +ventoy_keyboard_set_layout(AZERTY); +ventoy_keyboard_set_layout(CZECH_QWERTY); +ventoy_keyboard_set_layout(CZECH_QWERTZ); +ventoy_keyboard_set_layout(DANISH); +ventoy_keyboard_set_layout(DVORAK_USA); +ventoy_keyboard_set_layout(FRENCH); +ventoy_keyboard_set_layout(GERMAN); +ventoy_keyboard_set_layout(ITALIANO); +ventoy_keyboard_set_layout(JAPAN_106); +ventoy_keyboard_set_layout(LATIN_USA); +ventoy_keyboard_set_layout(PORTU_BRAZIL); +ventoy_keyboard_set_layout(QWERTY_UK); +ventoy_keyboard_set_layout(QWERTZ); +ventoy_keyboard_set_layout(QWERTZ_HUN); +ventoy_keyboard_set_layout(QWERTZ_SLOV_CROAT); +ventoy_keyboard_set_layout(SPANISH); +ventoy_keyboard_set_layout(SWEDISH); +ventoy_keyboard_set_layout(TURKISH_Q); +ventoy_keyboard_set_layout(VIETNAMESE); +} diff --git a/KBD/mkconfig.sh b/KBD/mkconfig.sh index b369005c..0e09792c 100644 --- a/KBD/mkconfig.sh +++ b/KBD/mkconfig.sh @@ -4,12 +4,13 @@ # Configfiles are from grubfilemanager project # -cfgfile=../INSTALL/grub/keyboard.cfg -rm -f ${cfgfile}.gz - -echo "submenu \"Keyboard Layouts\" --class=debug_krdlayout {" >>$cfgfile +cfgfile=keyboard_layout.c +rm -f ${cfgfile} cat >>$cfgfile << EOF + +#define ventoy_keyboard_set_layout(name) if (grub_strcmp(layout, #name) == 0) return ventoy_keyboard_layout_##name() + menuentry QWERTY_USA --class=debug_kbd { setkey -r setkey -d @@ -25,6 +26,59 @@ ls -1 cfg | while read line; do echo "}" >> $cfgfile done +dos2unix $cfgfile +sed 's/menuentry \([^ ]*\) .*/static void ventoy_keyboard_layout_\1(void) {/g' -i $cfgfile +sed 's/setkey *-r/grub_keymap_reset();/g' -i $cfgfile +sed 's/setkey *-d/grub_keymap_disable();/g' -i $cfgfile +sed 's/setkey *-e/grub_keymap_enable();/g' -i $cfgfile +sed 's/^setkey *\([^ ]*\) *\([^ ]*\)/grub_keymap_add_by_string("\1", "\2");/g' -i $cfgfile + +rm -f .tmpfunc +echo "void ventoy_set_keyboard_layout(const char *layout);" >> .tmpfunc +echo "void ventoy_set_keyboard_layout(const char *layout) {" >> .tmpfunc +grep 'void *ventoy_keyboard_layout_' $cfgfile | while read line; do + name=$(echo $line | sed 's/.*ventoy_keyboard_layout_\(.*\)(.*/\1/g') + echo "ventoy_keyboard_set_layout($name);" >> .tmpfunc +done + +echo "}" >> .tmpfunc + +cat .tmpfunc >> $cfgfile +rm -f .tmpfunc + +rm -f ../GRUB2/SRC/grub-2.04/grub-core/term/$cfgfile +cp -a $cfgfile ../GRUB2/SRC/grub-2.04/grub-core/term/$cfgfile + + + + + +############ +# +# cfg +############# + +cfgfile=../INSTALL/grub/keyboard.cfg +rm -f ${cfgfile} + +echo "submenu \"Keyboard Layouts\" --class=debug_krdlayout {" >>$cfgfile + +cat >>$cfgfile << EOF + menuentry QWERTY_USA --class=debug_kbd { + set_keyboard_layout QWERTY_USA + } +EOF + +ls -1 cfg | while read line; do + kbd=${line%.cfg} + name=${kbd#KBD_} + + echo " menuentry $name --class=debug_kbd {" >> $cfgfile + echo " set_keyboard_layout $name" >> $cfgfile + echo " }" >> $cfgfile +done + echo "}" >>$cfgfile -gzip $cfgfile + +