Received: from list by lists.gnu.org with archive (Exim 4.71) id 1fXsUg-0001qd-V1 for mharc-grub-devel@gnu.org; Tue, 26 Jun 2018 14:15:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXsUe-0001qE-HL for grub-devel@gnu.org; Tue, 26 Jun 2018 14:15:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXsUb-00006c-9Y for grub-devel@gnu.org; Tue, 26 Jun 2018 14:15:08 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:47634 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fXsUb-000068-56 for grub-devel@gnu.org; Tue, 26 Jun 2018 14:15:05 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 57B0981A43B0; Tue, 26 Jun 2018 18:15:03 +0000 (UTC) Received: from shalem.localdomain.com (ovpn-116-227.ams2.redhat.com [10.36.116.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id B95262026E1A; Tue, 26 Jun 2018 18:15:02 +0000 (UTC) From: Hans de Goede To: grub-devel@gnu.org Cc: Daniel Kiper , Hans de Goede Subject: [PATCH] EFI: console: Fix the "enter" key not working on X86 tablets Date: Tue, 26 Jun 2018 20:15:01 +0200 Message-Id: <20180626181501.20755-1-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 26 Jun 2018 18:15:03 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 26 Jun 2018 18:15:03 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'hdegoede@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 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: Tue, 26 Jun 2018 18:15:09 -0000 Most 8" or 7" x86 Windows 10 tablets come with volume up/down buttons and a power-button. In their UEFI these are almost always mapped to arrow up/down and enter. Pressing the volume buttons (sometimes by accident) will stop the menu countdown, but the power-button / "enter" key was not being recognized as enter, so the user would be stuck at the grub menu. The problem is that these tablets send scan_code 13 or 0x0d for the power-button, which officialy maps to the F3 key. They also set unicode_char to 0x0d. This commit recognizes the special case of both scan_code and unicode_char being set to 0x0d and treats this as an enter key press. This fixes things getting stuck at the grub-menu and allows the user to choice a grub-menu entry using the buttons on the tablet. Signed-off-by: Hans de Goede --- grub-core/term/efi/console.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c index 02f64ea74..1867bad1a 100644 --- a/grub-core/term/efi/console.c +++ b/grub-core/term/efi/console.c @@ -122,6 +122,9 @@ grub_efi_translate_key (grub_efi_input_key_t key) else return key.unicode_char; } + /* Some devices send enter with scan_code 0x0d (F3) and unicode_char 0x0d */ + else if (key.scan_code == '\r' && key.unicode_char == '\r') + return key.unicode_char; else if (key.scan_code < ARRAY_SIZE (efi_codes)) return efi_codes[key.scan_code]; -- 2.17.1