grub/grub-core/term
Hans de Goede 8bab36af60 efi/console: Add grub_console_read_key_stroke() helper function
This is a preparatory patch for adding getkeystatus() support to the
EFI console driver.

We can get modifier status through the simple_text_input read_key_stroke()
method, but if a non-modifier key is (also) pressed the read_key_stroke()
call will consume that key from the firmware's queue.

The new grub_console_read_key_stroke() helper buffers upto 1 key-stroke.
If it has a non-modifier key buffered, it will return that one, if its
buffer is empty, it will fills its buffer by getting a new key-stroke.

If called with consume=1 it will empty its buffer after copying the
key-data to the callers buffer, this is how getkey() will use it.

If called with consume=0 it will keep the last key-stroke buffered, this
is how getkeystatus() will call it. This means that if a non-modifier
key gets pressed, repeated getkeystatus() calls will return the modifiers
of that key-press until it is consumed by a getkey() call.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2020-04-21 22:11:17 +02:00
..
arc * grub-core/term/arc/console.c: Add missing cast to silence warning. 2013-11-24 05:05:34 +01:00
arm arm_coreboot: Add Chromebook keyboard driver. 2017-05-09 08:47:34 +02:00
efi efi/console: Add grub_console_read_key_stroke() helper function 2020-04-21 22:11:17 +02:00
i386 core: use GRUB_TERM_ definitions when handling term characters 2017-08-07 19:28:22 +02:00
ieee1275 * grub-core/term/ieee1275/escc.c (GRUB_MOD_INIT): Fix order of channels. 2013-11-10 17:53:11 +01:00
uboot Add progress module to display load progress of files. 2013-10-22 16:42:20 -02:00
xen Remove xen VFB. 2013-12-18 18:43:09 +01:00
at_keyboard.c at_keyboard: Fix unreliable key presses 2019-10-21 14:07:47 +02:00
gfxterm.c gfxterm: Fix clearing of cursor. 2017-01-31 18:49:37 +01:00
gfxterm_background.c Detach optional parts of gfxterm and integrate in with coreboot init. 2013-05-31 00:42:33 +02:00
morse.c Add progress module to display load progress of files. 2013-10-22 16:42:20 -02:00
ns8250.c Avoid division by zero in serial. 2015-01-21 17:42:13 +01:00
ps2.c at_keyboard: Split protocol from controller code. 2017-05-08 21:41:22 +02:00
serial.c misc: Make grub_strtol() "end" pointers have safer const qualifiers 2020-02-28 12:41:29 +01:00
spkmodem.c Add progress module to display load progress of files. 2013-10-22 16:42:20 -02:00
terminfo.c misc: Make grub_strtol() "end" pointers have safer const qualifiers 2020-02-28 12:41:29 +01:00
tparm.c Enable -Wformat=2 if it's supported. 2013-12-21 15:28:28 +01:00
usb_keyboard.c usb_keyboard: Remove useless include 2016-02-22 20:05:54 +01:00