From: Josh Triplett <josh@joshtriplett.org>
To: grub-devel@gnu.org
Subject: Re: [PATCH] grub-core/term/efi/console.c: Use EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL if available
Date: Mon, 30 Dec 2013 00:50:49 -0800 [thread overview]
Message-ID: <20131230085047.GA21703@leaf> (raw)
In-Reply-To: <52C1250D.2040906@gmail.com>
On Mon, Dec 30, 2013 at 08:47:25AM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> On 29.12.2013 08:04, Josh Triplett wrote:
> > + term->data = 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 to
> look for protocols on input handle.
Will do in v2.
> > + if (shift_state & (GRUB_EFI_RIGHT_SHIFT_PRESSED |
> GRUB_EFI_LEFT_SHIFT_PRESSED))
> > + result |= 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
next prev parent reply other threads:[~2013-12-30 8:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-29 7:04 [PATCH] grub-core/term/efi/console.c: Use EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL if available Josh Triplett
2013-12-30 7:47 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-30 8:50 ` Josh Triplett [this message]
2013-12-30 9:07 ` [PATCHv2] " Josh Triplett
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131230085047.GA21703@leaf \
--to=josh@joshtriplett.org \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.