Some Qualcomm-based UEFI platforms only provide
volume up, volume down, and power keys. The volume keys are already mapped to
SCAN_UP and SCAN_DOWN, while the power key is mapped to SCAN_SUSPEND (scan_code 
0x0102).

On such devices, the power key is commonly used as the "Enter" (confirm) button,
since no dedicated Enter key exists. This patch treats scan_code 0x0102
as Enter to improve usability on these platforms.

Signed-off-by: Kancy Joe <kancy2...@outlook.com>
---
 grub-core/term/efi/console.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c
index 258b52737..83322f128 100644
--- a/grub-core/term/efi/console.c
+++ b/grub-core/term/efi/console.c
@@ -219,6 +219,9 @@ grub_efi_translate_key (grub_efi_input_key_t key)
       else
        return key.unicode_char;
     }
+  /* Some devices use power key (scan_code 0x0102, suspend) as enter. */
+  else if (key.scan_code == 0x0102)
+    return '\r';
   /* Some devices send enter with scan_code 0x0d (F3) and unicode_char 0x0d. */
   else if (key.scan_code == '\r' && key.unicode_char == '\r')
     return key.unicode_char;
-- 
2.43.0


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to