From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VxYZE-0000KY-0R for mharc-grub-devel@gnu.org; Mon, 30 Dec 2013 03:51:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38093) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxYZ2-0000Ji-DS for grub-devel@gnu.org; Mon, 30 Dec 2013 03:51:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VxYYs-0006ki-Hv for grub-devel@gnu.org; Mon, 30 Dec 2013 03:51:08 -0500 Received: from relay5-d.mail.gandi.net ([2001:4b98:c:538::197]:47634) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxYYs-0006kU-Bs for grub-devel@gnu.org; Mon, 30 Dec 2013 03:50:58 -0500 Received: from mfilter20-d.gandi.net (mfilter20-d.gandi.net [217.70.178.148]) by relay5-d.mail.gandi.net (Postfix) with ESMTP id CB09D41C079 for ; Mon, 30 Dec 2013 09:50:53 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter20-d.gandi.net Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by mfilter20-d.gandi.net (mfilter20-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id PQI9PuQAIES7 for ; Mon, 30 Dec 2013 09:50:52 +0100 (CET) X-Originating-IP: 50.43.14.201 Received: from leaf (static-50-43-14-201.bvtn.or.frontiernet.net [50.43.14.201]) (Authenticated sender: josh@joshtriplett.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 77AFF41C067 for ; Mon, 30 Dec 2013 09:50:51 +0100 (CET) Date: Mon, 30 Dec 2013 00:50:49 -0800 From: Josh Triplett To: grub-devel@gnu.org Subject: Re: [PATCH] grub-core/term/efi/console.c: Use EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL if available Message-ID: <20131230085047.GA21703@leaf> References: <20131229070445.GA28511@leaf> <52C1250D.2040906@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <52C1250D.2040906@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4b98:c:538::197 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: Mon, 30 Dec 2013 08:51:18 -0000 On Mon, Dec 30, 2013 at 08:47:25AM +0100, Vladimir '=CF=86-coder/phcoder'= Serbinenko wrote: > On 29.12.2013 08:04, Josh Triplett wrote: > > + term->data =3D grub_efi_locate_protocol(&simple_text_input_ex_guid= , NULL); > This will find the first handle that provides > EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL, not necessarily the same as normal > console and you may inadvertently switch to another console. You have t= o > look for protocols on input handle. Will do in v2. > > + if (shift_state & (GRUB_EFI_RIGHT_SHIFT_PRESSED | > GRUB_EFI_LEFT_SHIFT_PRESSED)) > > + result |=3D GRUB_TERM_SHIFT; > The keys which have natural meaning for shifted version never should > receive GRUB_TERM_SHIFT. E.g. Shift+d should give 'D', not > 'd'|GRUB_TERM_SHIFT. > Easiest way is to add GRUB_TERM_SHIFT only if GRUB_TERM_EXTENDED is > already present. The EFI interface already does that; the documentation for EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL explicitly states that it will not return the shift modifiers for shift+character combinations that compose into a single Unicode character. So, shift+'d' will indeed show up as 'D' with shift not set, while shift+left will show up as shift+left. I did explicitly test that case; it works exactly as it should. Also, filtering on GRUB_TERM_EXTENDED wouldn't give the right results for things like shift+space, shift+tab, or shift+backspace, since the corresponding unshifted characters don't have GRUB_TERM_EXTENDED set. > What about providing keystatus function? The protocol doesn't have a function to return the current modifier state, only to return a character with accompanying modifiers. - Josh Triplett