grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Make CTRL and ALT keys work as expected on EFI systems (vers


From: Vladimir 'φ-coder/phcoder' Serbinenko
Subject: Re: [PATCH] Make CTRL and ALT keys work as expected on EFI systems (version 5).
Date: Sun, 25 Oct 2015 16:41:07 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.2.0

On 25.02.2014 23:12, Peter Jones wrote:
> This is version 4.
> 
> Changes from version 1:
> - handles SHIFT as a modifier
> - handles F11 and F12 keys
> - uses the handle provided by the system table to find our _EX protocol.
> 
> Changes from version 2:
> - eliminate duplicate keycode translation.
> 
> Changes from version 3:
> - Do not add the shift modifier for any ascii character between space
>   (0x20) and DEL (0x7f); the combination of the modifier and many of the
>   keys causes it not to be recognized at all.  Specifically, if we
>   include the modifier on any querty punctuation character, i.e.
>   anything the string "address@hidden&*()_+{}|:\"<>?" represents in C, it 
> stops
>   being recognized whatsoever.
> 
> Changes from version 4:
> - Always initialize term->data from locate protocol (i.e. make it
>   unconditional.)
> 
> Signed-off-by: Peter Jones <address@hidden>
> ---
>  grub-core/term/efi/console.c | 118 
> +++++++++++++++++++++++++++++++++++--------
>  include/grub/efi/api.h       |  65 +++++++++++++++++++++++-
>  2 files changed, 161 insertions(+), 22 deletions(-)
> 
> diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c
> index a37eb84..677eab5 100644
> --- a/grub-core/term/efi/console.c
> +++ b/grub-core/term/efi/console.c
> @@ -104,26 +104,12 @@ const unsigned efi_codes[] =
>      GRUB_TERM_KEY_DC, GRUB_TERM_KEY_PPAGE, GRUB_TERM_KEY_NPAGE, 
> GRUB_TERM_KEY_F1,
>      GRUB_TERM_KEY_F2, GRUB_TERM_KEY_F3, GRUB_TERM_KEY_F4, GRUB_TERM_KEY_F5,
>      GRUB_TERM_KEY_F6, GRUB_TERM_KEY_F7, GRUB_TERM_KEY_F8, GRUB_TERM_KEY_F9,
> -    GRUB_TERM_KEY_F10, 0, 0, '\e'
> +    GRUB_TERM_KEY_F10, GRUB_TERM_KEY_F10, GRUB_TERM_KEY_F11, '\e'
>    };
>  
Yikes
> -
>  static int
> -grub_console_getkey (struct grub_term_input *term __attribute__ ((unused)))
> +grub_efi_translate_key (grub_efi_input_key_t key)
>  {
> -  grub_efi_simple_input_interface_t *i;
> -  grub_efi_input_key_t key;
> -  grub_efi_status_t status;
> -
> -  if (grub_efi_is_finished)
> -    return 0;
> -
> -  i = grub_efi_system_table->con_in;
> -  status = efi_call_2 (i->read_key_stroke, i, &key);
> -
> -  if (status != GRUB_EFI_SUCCESS)
> -    return GRUB_TERM_NO_KEY;
> -
>    if (key.scan_code == 0)
>      {
>        /* Some firmware implementations use VT100-style codes against the 
> spec.
> @@ -139,9 +125,98 @@ grub_console_getkey (struct grub_term_input *term 
> __attribute__ ((unused)))
>    else if (key.scan_code < ARRAY_SIZE (efi_codes))
>      return efi_codes[key.scan_code];
>  
> +  if (key.unicode_char >= 0x20 && key.unicode_char <= 0x7f)
> +    return key.unicode_char;
> +
This ignores enter, tab and so on.

I fixed 2 above issues and committed.

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]