All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Jones <pjones@redhat.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH] Make CTRL and ALT keys work as expected on EFI systems (version 5).
Date: Mon, 12 Oct 2015 10:47:28 -0400	[thread overview]
Message-ID: <20151012144727.GB19125@redhat.com> (raw)
In-Reply-To: <56195D9A.2010306@gmail.com>

On Sat, Oct 10, 2015 at 09:48:58PM +0300, Andrei Borzenkov wrote:

Sorry - realized I should have addressed your question and said one more
thing.

> Are there open issues with this patch? Is it used by Fedora? The part about
> SHIFT state bothers me, what happens for non-ASCII printable characters?
> UEFI spec is extremely vague here.

As for non-ASCII printables, I have no idea.  I literally couldn't find
a keyboard that generated any around my office.  Even my European and
Japanese coworkers don't seem to have them.  That said, given the
comment here:
 https://github.com/vathpela/edk2/blob/master/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c#L481
and the two tables here:
 https://github.com/vathpela/edk2/blob/master/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c#L36
 https://github.com/vathpela/edk2/blob/master/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c#L149
my guess is that on the vast majority of systems they just don't produce
any keypress.  We could do things like make right-alt act like AltGr and
synthesize them ourselves, of course, if there's a significant need.
(Awesomely, AltGr is defined by the EFI modifier list but not mapped
from the USB bits.  Which probably doesn't matter, since nobody uses
keyboards with AltGr keys.)

> As currently there is no way to actually input Ctrl-X or similar this is
> needed. It may also allow us to actually implement keystatus on EFI.

One issue related to implementing keystatus is the "Windows Fast Boot"
feature, enabled by default in nearly all "client" machines now.  (It's
a Windows logo requirement.)  This feature basically says not to probe
USB and the like by default.  So on any machines where your input
device is USB, what winds up happening is that it probes for HII devices
when you call ->read_key_stroke() or ->read_key_stroke_ex() the first
time.  Depending on the hardware configuration, how many devices are
plugged in, how many hubs away the keyboard is, etc., this can take a
surprisingly long period of time.  (FWIW, I *think*
register_key_notify() and set_key_state() will also trigger the driver
loading and probing on most implementations.)

For practical purposes right now, this is pretty much okay with how most
people are using GRUB.  But if somebody wanted to implement "don't show
menus unless the user requested it before the reboot, or the last boot
failed" in their grub config file, then the user gets a much quicker
boot experience if we don't scan the keyboard.

-- 
        Peter


  parent reply	other threads:[~2015-10-12 14:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-25 22:12 [PATCH] Make CTRL and ALT keys work as expected on EFI systems (version 5) Peter Jones
2014-02-26  2:58 ` Mroczek, Joseph T
2014-02-26 18:51   ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-10-10 18:48 ` Andrei Borzenkov
2015-10-12 14:19   ` Peter Jones
2015-10-12 14:47   ` Peter Jones [this message]
2015-10-13  3:50     ` Andrei Borzenkov
2015-10-25 15:41 ` Vladimir 'φ-coder/phcoder' Serbinenko

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=20151012144727.GB19125@redhat.com \
    --to=pjones@redhat.com \
    --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.