From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1b2MaQ-0002RV-0Z for mharc-grub-devel@gnu.org; Mon, 16 May 2016 13:45:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2MaK-0002Ec-D4 for grub-devel@gnu.org; Mon, 16 May 2016 13:45:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2MaH-0005pZ-AK for grub-devel@gnu.org; Mon, 16 May 2016 13:45:40 -0400 Received: from mout01.posteo.de ([185.67.36.65]:36247) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2MaG-0005o7-Vz for grub-devel@gnu.org; Mon, 16 May 2016 13:45:37 -0400 Received: from dovecot03.posteo.de (dovecot03.posteo.de [172.16.0.13]) by mout01.posteo.de (Postfix) with ESMTPS id 5FF6A20887 for ; Sun, 15 May 2016 20:18:16 +0200 (CEST) Received: from mail.posteo.de (localhost [127.0.0.1]) by dovecot03.posteo.de (Postfix) with ESMTPSA id 3r7Bfb2l7zz5vMK for ; Sun, 15 May 2016 20:18:15 +0200 (CEST) Message-ID: <5738BDB1.2070005@posteo.org> Date: Sun, 15 May 2016 20:19:29 +0200 From: fgndevelop User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: Patch for German keyboard layout for the at_keyboard input Content-Type: multipart/mixed; boundary="------------090709070908000507040204" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 185.67.36.65 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 17:45:43 -0000 This is a multi-part message in MIME format. --------------090709070908000507040204 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Dear team at grub-devel, First of all I would like to thank you for the Grand boot loader, your work is very much appreciated. Recently I downloaded the current grub-2.02-beta3 and started experimenting with it. I am am making use of the luks module in GRUB to provide my clients with fully encrypted harddrives. Since my clients are German, and I keep telling them that strong passwords should contain special characters, I ended up modifying the default keyboard layout for the at_keyboard.c input driver. I provided the diff in keylayouts.c.diff, if you want to make use of it. The support for German keys is only partial, since some of the German keys are non-ASCII. Also I patched at_keyboard.c. It has a minor typo, in line 91 both scancode 0x52 and 0x53 are mapped to the same GRUB_KEYBOARD_KEY_NUMDOT. This is wrong, scancode 0x52 has to be mapped to GRUB_KEYBOARD_KEY_NUM0 (as that's what it is). Last but not least, parsing through include/grub/keyboard_layouts.h, I realized that the enumeration of GRUB_KEYBOARD_KEY_* is skipping value 0x31: > GRUB_KEYBOARD_KEY_RBRACKET = 0x30, > GRUB_KEYBOARD_KEY_BACKSLASH = 0x32, I do not know why this is the case, but from my point of view this probably lead to the following comment ( in grub-core/commands/keylayouts.c ): > /* According to usage table 0x31 should be mapped to '/' > but testing with real keyboard shows that 0x32 is remapped to '/'. > Map 0x31 to 0. Cleaning up the enumeration would do some good, I guess. Find attached both aformentioned patches. I'll be glad help out if you deem it appropriate to, e.g. make the support for German at_keyboard layout a configurable option. Regards, Frank --------------090709070908000507040204 Content-Type: text/x-patch; name="keylayouts.c.diff" Content-Disposition: attachment; filename="keylayouts.c.diff" Content-Transfer-Encoding: quoted-printable --- keylayouts.c.orig 2016-05-15 18:37:53.748056892 +0200 +++ keylayouts.c 2016-05-15 19:41:45.187943685 +0200 @@ -30,7 +30,7 @@ =20 GRUB_MOD_LICENSE ("GPLv3+"); =20 -static struct grub_keyboard_layout layout_us =3D { +static struct grub_keyboard_layout layout_de =3D { .keyboard_map =3D { /* Keyboard errors. Handled by driver. */ /* 0x00 */ 0, 0, 0, 0, @@ -38,16 +38,16 @@ /* 0x04 */ 'a', 'b', 'c', 'd',=20 /* 0x08 */ 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', /* 0x10 */ 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', - /* 0x18 */ 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', + /* 0x18 */ 'u', 'v', 'w', 'x', 'z', 'y', '1', '2', /* 0x20 */ '3', '4', '5', '6', '7', '8', '9', '0', - /* 0x28 */ '\n', '\e', '\b', '\t', ' ', '-', '=3D', '[', + /* 0x28 */ '\n', '\e', '\b', '\t', ' ', 's', '\'', 'u', /* s =3D =C3= =9F, ' =3D =C2=B4, u =3D =C3=BC */ /* According to usage table 0x31 should be mapped to '/' but testing with real keyboard shows that 0x32 is remapped to '/'= . Map 0x31 to 0.=20 */ - /* 0x30 */ ']', 0, '\\', ';', '\'', '`', ',', '.', + /* 0x30 */ '+', 0, '#', 'o', 'a', '^', ',', '.', /* o =3D =C3=B6= , a =3D =C3=A4 */ /* 0x39 is CapsLock. Handled by driver. */ - /* 0x38 */ '/', 0, GRUB_TERM_KEY_F1, GRUB_TERM_KEY_F2,=20 + /* 0x38 */ '-', 0, GRUB_TERM_KEY_F1, GRUB_TERM_KEY_F2,=20 /* 0x3c */ GRUB_TERM_KEY_F3, GRUB_TERM_KEY_F4, /* 0x3e */ GRUB_TERM_KEY_F5, GRUB_TERM_KEY_F6, /* 0x40 */ GRUB_TERM_KEY_F7, GRUB_TERM_KEY_F8, @@ -71,7 +71,7 @@ /* 0x5e */ GRUB_TERM_KEY_RIGHT, GRUB_TERM_KEY_HOME, /* 0x60 */ GRUB_TERM_KEY_UP, GRUB_TERM_KEY_PPAGE, /* 0x62 */ GRUB_TERM_KEY_INSERT, GRUB_TERM_KEY_DC, - /* 0x64 */ '\\' + /* 0x64 */ '<' }, .keyboard_map_shift =3D { /* Keyboard errors. Handled by driver. */ @@ -80,18 +80,18 @@ /* 0x04 */ 'A', 'B', 'C', 'D',=20 /* 0x08 */ 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', /* 0x10 */ 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', - /* 0x18 */ 'U', 'V', 'W', 'X', 'Y', 'Z', '!', '@', - /* 0x20 */ '#', '$', '%', '^', '&', '*', '(', ')', + /* 0x18 */ 'U', 'V', 'W', 'X', 'Z', 'Y', '!', '\"', + /* 0x20 */ 'P', '$', '%', '&', '/', '(', ')', '=3D', /* P =3D =C2= =A7 */ /* 0x28 */ '\n' | GRUB_TERM_SHIFT, '\e' | GRUB_TERM_SHIFT,=20 /* 0x2a */ '\b' | GRUB_TERM_SHIFT, '\t' | GRUB_TERM_SHIFT,=20 - /* 0x2c */ ' ' | GRUB_TERM_SHIFT, '_', '+', '{', + /* 0x2c */ ' ' | GRUB_TERM_SHIFT, '?', '`', 'U', /* U =3D =C3=9C *= / /* According to usage table 0x31 should be mapped to '/' but testing with real keyboard shows that 0x32 is remapped to '/'= . Map 0x31 to 0.=20 */ - /* 0x30 */ '}', 0, '|', ':', '"', '~', '<', '>', + /* 0x30 */ '*', 0, '\'', 'O', 'A', '^', ';', ':', /* O =3D =C3= =96, ^ =3D =C2=B0 */ /* 0x39 is CapsLock. Handled by driver. */ - /* 0x38 */ '?', 0, + /* 0x38 */ '_', 0, /* 0x3a */ GRUB_TERM_KEY_F1 | GRUB_TERM_SHIFT, /* 0x3b */ GRUB_TERM_KEY_F2 | GRUB_TERM_SHIFT,=20 /* 0x3c */ GRUB_TERM_KEY_F3 | GRUB_TERM_SHIFT,=20 @@ -121,11 +121,59 @@ /* 0x54 */ '/', '*',=20 /* 0x56 */ '-', '+', /* 0x58 */ '\n' | GRUB_TERM_SHIFT, '1', '2', '3', '4', '5','6', '7', - /* 0x60 */ '8', '9', '0', '.', '|' + /* 0x60 */ '8', '9', '0', ',', '>' + }, + .keyboard_map_l3 =3D { + /* Keyboard errors. Handled by driver. */ + /* 0x00 */ 0, 0, 0, 0, + + /* 0x04 */ 0, 0, 0, 0,=20 + /* 0x08 */ 'e', 0, 0, 0, 0, 0, 0, 0, /* e =3D =E2=82=AC */ + /* 0x10 */ 0, 0, 0, 0, '@', 0, 0, 0, =20 + /* 0x18 */ 0, 0, 0, 0, 0, 0, 0, '2', /* 2 =3D =C2=B2 */ + /* 0x20 */ 3, 0, 0, 0, '{', '[', ']', '}', /* 3 =3D =C2=B3 */ + /* 0x28 */ 0, 0, 0, 0, 0, '\\', + /* 0x2e */ 0, 0,=20 + /* According to usage table 0x31 should be mapped to '/' + but testing with real keyboard shows that 0x32 is remapped to '/'= . + Map 0x31 to 0.=20 + */ + /* 0x30 */ '~', 0, 0, 0, 0, 0, 0, 0,=20 + /* 0x39 is CapsLock. Handled by driver. */ + /* 0x38 */ 0, 0, + /* 0x3a */ GRUB_TERM_KEY_F1 | GRUB_TERM_ALT, + /* 0x3b */ GRUB_TERM_KEY_F2 | GRUB_TERM_ALT,=20 + /* 0x3c */ GRUB_TERM_KEY_F3 | GRUB_TERM_ALT,=20 + /* 0x3d */ GRUB_TERM_KEY_F4 | GRUB_TERM_ALT,=20 + /* 0x3e */ GRUB_TERM_KEY_F5 | GRUB_TERM_ALT,=20 + /* 0x3f */ GRUB_TERM_KEY_F6 | GRUB_TERM_ALT,=20 + /* 0x40 */ GRUB_TERM_KEY_F7 | GRUB_TERM_ALT,=20 + /* 0x41 */ GRUB_TERM_KEY_F8 | GRUB_TERM_ALT,=20 + /* 0x42 */ GRUB_TERM_KEY_F9 | GRUB_TERM_ALT,=20 + /* 0x43 */ GRUB_TERM_KEY_F10 | GRUB_TERM_ALT,=20 + /* 0x44 */ GRUB_TERM_KEY_F11 | GRUB_TERM_ALT,=20 + /* 0x45 */ GRUB_TERM_KEY_F12 | GRUB_TERM_ALT,=20 + /* PrtScr and ScrollLock. Not handled yet. */ + /* 0x46 */ 0, 0, + /* 0x48 is Pause. Not handled yet. */ + /* 0x48 */ 0, GRUB_TERM_KEY_INSERT | GRUB_TERM_AL= T,=20 + /* 0x4a */ GRUB_TERM_KEY_HOME | GRUB_TERM_ALT, + /* 0x4b */ GRUB_TERM_KEY_PPAGE | GRUB_TERM_ALT, + /* 0x4c */ GRUB_TERM_KEY_DC | GRUB_TERM_ALT, + /* 0x4d */ GRUB_TERM_KEY_END | GRUB_TERM_ALT, + /* 0x4e */ GRUB_TERM_KEY_NPAGE | GRUB_TERM_ALT, + /* 0x4f */ GRUB_TERM_KEY_RIGHT | GRUB_TERM_ALT, + /* 0x50 */ GRUB_TERM_KEY_LEFT | GRUB_TERM_ALT, + /* 0x51 */ GRUB_TERM_KEY_DOWN | GRUB_TERM_ALT, + /* 0x53 is NumLock. Handled by driver. */ + /* 0x52 */ GRUB_TERM_KEY_UP | GRUB_TERM_ALT, 0, + /* 0x54 */ 0, 0, 0, 0,=20 + /* 0x58 */ 0, 0, 0, 0, 0, 0, 0, 0, + /* 0x60 */ 0, 0, 0, 0, '|' } }; =20 -static struct grub_keyboard_layout *grub_current_layout =3D &layout_us; +static struct grub_keyboard_layout *grub_current_layout =3D &layout_de; =20 static int map_key_core (int code, int status, int *alt_gr_consumed) --------------090709070908000507040204 Content-Type: text/x-patch; name="at_keyboard.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="at_keyboard.c.diff" --- at_keyboard.c 2016-02-28 03:07:41.000000000 +0100 +++ grub-2.02-beta3/grub-core/term/at_keyboard.c 2016-05-14 23:34:50.635451129 +0200 @@ -88,7 +88,7 @@ /* 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, + /* 0x52 */ GRUB_KEYBOARD_KEY_NUM0, GRUB_KEYBOARD_KEY_NUMDOT, /* 0x54 */ 0, 0, /* 0x56 */ GRUB_KEYBOARD_KEY_102ND, GRUB_KEYBOARD_KEY_F11, /* 0x58 */ GRUB_KEYBOARD_KEY_F12, 0, --------------090709070908000507040204--