From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZqNQW-0003lN-83 for mharc-grub-devel@gnu.org; Sun, 25 Oct 2015 11:41:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZqNQT-0003ks-6b for grub-devel@gnu.org; Sun, 25 Oct 2015 11:41:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZqNQS-0002gm-6p for grub-devel@gnu.org; Sun, 25 Oct 2015 11:41:41 -0400 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:38865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZqNQS-0002gi-0e for grub-devel@gnu.org; Sun, 25 Oct 2015 11:41:40 -0400 Received: by wicll6 with SMTP id ll6so84534741wic.1 for ; Sun, 25 Oct 2015 08:41:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type; bh=/6jZq4m4Wq8lewGEWx9vUsEcFPnozasMY/JuBngHeBc=; b=u8dpIUJ6Kpci+BXIbR6jBK5nWFZm4nBXnbB7gsHspJhHKjjUc/g/+EPk4C6tofhPzQ H6hB1xE9SkSVQx0j95nuFmUp5lxhBb2vHeerR1ADzxkk3r+FYIiMcJXpNjzrnwWz/jaR ShczWOgRZJNOiCPz0DCcq+ljdiAY24VfFWOG3pkmu79CUTt31X1Pcuh0OTKweb4f0+ZU gCp3LA+1ERwWwuM+P4AM2qsSrgWdLAdbv+eovgDPkEujQkR1k9zp+IwRTb9Lfc+xVQrg g+pUwTdyRzfFcIET/vXHGk0kB6kL7Cf8ImOVUuzZjNAtZ3pUr4XCy4zK6o00lh/UhZle vj5A== X-Received: by 10.180.102.135 with SMTP id fo7mr15846957wib.0.1445787699378; Sun, 25 Oct 2015 08:41:39 -0700 (PDT) Received: from ?IPv6:2a02:120b:2c08:1c10:863a:4bff:fe50:abc4? ([2a02:120b:2c08:1c10:863a:4bff:fe50:abc4]) by smtp.gmail.com with ESMTPSA id r65sm1581379wmb.20.2015.10.25.08.41.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Oct 2015 08:41:38 -0700 (PDT) Subject: Re: [PATCH] Make CTRL and ALT keys work as expected on EFI systems (version 5). To: The development of GNU GRUB References: <1393366348-22020-1-git-send-email-pjones@redhat.com> From: =?UTF-8?Q?Vladimir_'=cf=86-coder/phcoder'_Serbinenko?= Message-ID: <562CF813.9030901@gmail.com> Date: Sun, 25 Oct 2015 16:41:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.2.0 MIME-Version: 1.0 In-Reply-To: <1393366348-22020-1-git-send-email-pjones@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="MI7asAIesJ2iHNnF5hCA2gPDxc6JdgDcm" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::229 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2015 15:41:42 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --MI7asAIesJ2iHNnF5hCA2gPDxc6JdgDcm Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 25.02.2014 23:12, Peter Jones wrote: > This is version 4. >=20 > Changes from version 1: > - handles SHIFT as a modifier > - handles F11 and F12 keys > - uses the handle provided by the system table to find our _EX protocol= =2E >=20 > Changes from version 2: > - eliminate duplicate keycode translation. >=20 > Changes from version 3: > - Do not add the shift modifier for any ascii character between space > (0x20) and DEL (0x7f); the combination of the modifier and many of th= e > keys causes it not to be recognized at all. Specifically, if we > include the modifier on any querty punctuation character, i.e. > anything the string "~!@#$%^&*()_+{}|:\"<>?" represents in C, it stop= s > being recognized whatsoever. >=20 > Changes from version 4: > - Always initialize term->data from locate protocol (i.e. make it > unconditional.) >=20 > Signed-off-by: Peter Jones > --- > grub-core/term/efi/console.c | 118 +++++++++++++++++++++++++++++++++++= -------- > include/grub/efi/api.h | 65 +++++++++++++++++++++++- > 2 files changed, 161 insertions(+), 22 deletions(-) >=20 > diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.= c > index a37eb84..677eab5 100644 > --- a/grub-core/term/efi/console.c > +++ b/grub-core/term/efi/console.c > @@ -104,26 +104,12 @@ const unsigned efi_codes[] =3D > GRUB_TERM_KEY_DC, GRUB_TERM_KEY_PPAGE, GRUB_TERM_KEY_NPAGE, GRUB_T= ERM_KEY_F1, > GRUB_TERM_KEY_F2, GRUB_TERM_KEY_F3, GRUB_TERM_KEY_F4, GRUB_TERM_KE= Y_F5, > GRUB_TERM_KEY_F6, GRUB_TERM_KEY_F7, GRUB_TERM_KEY_F8, GRUB_TERM_KE= Y_F9, > - GRUB_TERM_KEY_F10, 0, 0, '\e' > + GRUB_TERM_KEY_F10, GRUB_TERM_KEY_F10, GRUB_TERM_KEY_F11, '\e' > }; > =20 Yikes > - > static int > -grub_console_getkey (struct grub_term_input *term __attribute__ ((unus= ed))) > +grub_efi_translate_key (grub_efi_input_key_t key) > { > - grub_efi_simple_input_interface_t *i; > - grub_efi_input_key_t key; > - grub_efi_status_t status; > - > - if (grub_efi_is_finished) > - return 0; > - > - i =3D grub_efi_system_table->con_in; > - status =3D efi_call_2 (i->read_key_stroke, i, &key); > - > - if (status !=3D GRUB_EFI_SUCCESS) > - return GRUB_TERM_NO_KEY; > - > if (key.scan_code =3D=3D 0) > { > /* Some firmware implementations use VT100-style codes against t= he spec. > @@ -139,9 +125,98 @@ grub_console_getkey (struct grub_term_input *term = __attribute__ ((unused))) > else if (key.scan_code < ARRAY_SIZE (efi_codes)) > return efi_codes[key.scan_code]; > =20 > + if (key.unicode_char >=3D 0x20 && key.unicode_char <=3D 0x7f) > + return key.unicode_char; > + This ignores enter, tab and so on. I fixed 2 above issues and committed. --MI7asAIesJ2iHNnF5hCA2gPDxc6JdgDcm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREKAAYFAlYs+BMACgkQmBXlbbo5nOumFQEAgMWOVxksKmXziV5stCMwOkcw ZuG4Lw/hPqB2IRuOAlwA/jYjyxHLt4J0WGIz/zkQ8+HtlFksBZzjP8hxzuhcXAlF =9/8v -----END PGP SIGNATURE----- --MI7asAIesJ2iHNnF5hCA2gPDxc6JdgDcm--