Re: [PATCH 2/4] Accept Both ESC and F8 as user interrupt keys

2018-04-05 Thread Daniel Kiper
On Wed, Mar 28, 2018 at 05:58:16PM +0200, Hans de Goede wrote:
> Hi,
>
> On 28-03-18 17:11, Lennart Sorensen wrote:
> >On Wed, Mar 28, 2018 at 05:06:53PM +0200, Hans de Goede wrote:
> >>Hmm, well people will still be able to use ESC to get the grub boot
> >>menu, rather then the firmware boot-menu on those.
> >>
> >>The problem is that our current check for ESC only approach is problematic
> >>because it conflicts with the enter firmware-setup key on almost all Bay 
> >>Trail,
> >>Cherry Trail and Apollo Lake devices. You need to try hard to find a device
> >>in one of those 3 categories which does not use ESC for this. Note I'm
> >>aware some devices exist, but using ESC for this is really really common
> >>among these devices.
> >>
> >>I'm open to other suggestions, but I think we really need to add another
> >>key to avoid the pressing ESC at boot already has another meaning problem
> >>and F8 seems like an ok choice.
> >>
> >>Either way thank you for the input on this.
> >
> >I don't disagree about having another key, I just disagree that F8 is
> >a good choice.
> >
> >Looking at https://kb.wisc.edu/page.php?id=58779#here it appears no one
> >uses F4 for anything.  That would seem like a better choice than F8
> >at least.  F6 also seems to be free but F4 seems nicer on desktop
> >keyboards.
>
> Looking at that table I have to agree that F4 seems like the best second
> key to use. Actually looking at that table ESC seems like a poor choice,
> but I guess it makes sense for serial-terminals as well as from a general
> UI pov (and we're stuck with it now anyways).
>
> I'm going to wait for Daniel's review of the other patches before I do
> a v2 of this patch-set. I will switch to F4 for v2.

Please leave ESC as is and add F4 key. Though I would provide an option
to change the defaults at runtime.

Daniel

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


Re: [PATCH 2/4] Accept Both ESC and F8 as user interrupt keys

2018-03-28 Thread Hans de Goede

Hi,

On 28-03-18 17:11, Lennart Sorensen wrote:

On Wed, Mar 28, 2018 at 05:06:53PM +0200, Hans de Goede wrote:

Hmm, well people will still be able to use ESC to get the grub boot
menu, rather then the firmware boot-menu on those.

The problem is that our current check for ESC only approach is problematic
because it conflicts with the enter firmware-setup key on almost all Bay Trail,
Cherry Trail and Apollo Lake devices. You need to try hard to find a device
in one of those 3 categories which does not use ESC for this. Note I'm
aware some devices exist, but using ESC for this is really really common
among these devices.

I'm open to other suggestions, but I think we really need to add another
key to avoid the pressing ESC at boot already has another meaning problem
and F8 seems like an ok choice.

Either way thank you for the input on this.


I don't disagree about having another key, I just disagree that F8 is
a good choice.

Looking at https://kb.wisc.edu/page.php?id=58779#here it appears no one
uses F4 for anything.  That would seem like a better choice than F8
at least.  F6 also seems to be free but F4 seems nicer on desktop
keyboards.


Looking at that table I have to agree that F4 seems like the best second
key to use. Actually looking at that table ESC seems like a poor choice,
but I guess it makes sense for serial-terminals as well as from a general
UI pov (and we're stuck with it now anyways).

I'm going to wait for Daniel's review of the other patches before I do
a v2 of this patch-set. I will switch to F4 for v2.

Regards,

Hans


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


Re: [PATCH 2/4] Accept Both ESC and F8 as user interrupt keys

2018-03-28 Thread Lennart Sorensen
On Wed, Mar 28, 2018 at 05:06:53PM +0200, Hans de Goede wrote:
> Hmm, well people will still be able to use ESC to get the grub boot
> menu, rather then the firmware boot-menu on those.
> 
> The problem is that our current check for ESC only approach is problematic
> because it conflicts with the enter firmware-setup key on almost all Bay 
> Trail,
> Cherry Trail and Apollo Lake devices. You need to try hard to find a device
> in one of those 3 categories which does not use ESC for this. Note I'm
> aware some devices exist, but using ESC for this is really really common
> among these devices.
> 
> I'm open to other suggestions, but I think we really need to add another
> key to avoid the pressing ESC at boot already has another meaning problem
> and F8 seems like an ok choice.
> 
> Either way thank you for the input on this.

I don't disagree about having another key, I just disagree that F8 is
a good choice.

Looking at https://kb.wisc.edu/page.php?id=58779#here it appears no one
uses F4 for anything.  That would seem like a better choice than F8
at least.  F6 also seems to be free but F4 seems nicer on desktop
keyboards.

-- 
Len Sorensen

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


Re: [PATCH 2/4] Accept Both ESC and F8 as user interrupt keys

2018-03-28 Thread Hans de Goede

Hi,

On 28-03-18 16:56, Lennart Sorensen wrote:

On Wed, Mar 28, 2018 at 04:50:26PM +0200, Hans de Goede wrote:

On most Bay Trail, Cherry Trail and Apollo Lake devices the ESC key is
the hotkey to enter the BIOS/EFI setup screen.

This makes it hard for the user to show the grub-menu when it is hidden
and a short timeout is used, because pressing ESC too early leads to the
user entering the BIOS/EFI setup screen.

F8 is (almost?) always free (on X86/PC platforms) as Windows uses this for
its boot menu, so also accept F8 as interrupt/show-menu key. As an added
advantage this is also more discoverable / easier for users coming from
Windows.


I have seen F8 and F12 used as boot menu keys on many systems.  I would
not consider it usually free.  Maybe it has become less common after
windows started using it, but it isn't that unusual.  ASUS seems to be
a major user of F8 for boot menu.  Not exactly an uncommon system board.
Some Lenovo desktops also use F8 for the boot menu.


Hmm, well people will still be able to use ESC to get the grub boot
menu, rather then the firmware boot-menu on those.

The problem is that our current check for ESC only approach is problematic
because it conflicts with the enter firmware-setup key on almost all Bay Trail,
Cherry Trail and Apollo Lake devices. You need to try hard to find a device
in one of those 3 categories which does not use ESC for this. Note I'm
aware some devices exist, but using ESC for this is really really common
among these devices.

I'm open to other suggestions, but I think we really need to add another
key to avoid the pressing ESC at boot already has another meaning problem
and F8 seems like an ok choice.

Either way thank you for the input on this.

Regards,

Hans

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


Re: [PATCH 2/4] Accept Both ESC and F8 as user interrupt keys

2018-03-28 Thread Lennart Sorensen
On Wed, Mar 28, 2018 at 04:50:26PM +0200, Hans de Goede wrote:
> On most Bay Trail, Cherry Trail and Apollo Lake devices the ESC key is
> the hotkey to enter the BIOS/EFI setup screen.
> 
> This makes it hard for the user to show the grub-menu when it is hidden
> and a short timeout is used, because pressing ESC too early leads to the
> user entering the BIOS/EFI setup screen.
> 
> F8 is (almost?) always free (on X86/PC platforms) as Windows uses this for
> its boot menu, so also accept F8 as interrupt/show-menu key. As an added
> advantage this is also more discoverable / easier for users coming from
> Windows.

I have seen F8 and F12 used as boot menu keys on many systems.  I would
not consider it usually free.  Maybe it has become less common after
windows started using it, but it isn't that unusual.  ASUS seems to be
a major user of F8 for boot menu.  Not exactly an uncommon system board.
Some Lenovo desktops also use F8 for the boot menu.

-- 
Len Sorensen

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


[PATCH 2/4] Accept Both ESC and F8 as user interrupt keys

2018-03-28 Thread Hans de Goede
On most Bay Trail, Cherry Trail and Apollo Lake devices the ESC key is
the hotkey to enter the BIOS/EFI setup screen.

This makes it hard for the user to show the grub-menu when it is hidden
and a short timeout is used, because pressing ESC too early leads to the
user entering the BIOS/EFI setup screen.

F8 is (almost?) always free (on X86/PC platforms) as Windows uses this for
its boot menu, so also accept F8 as interrupt/show-menu key. As an added
advantage this is also more discoverable / easier for users coming from
Windows.

Signed-off-by: Hans de Goede 
---
 grub-core/commands/sleep.c | 8 ++--
 grub-core/normal/menu.c| 7 ---
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/grub-core/commands/sleep.c b/grub-core/commands/sleep.c
index e77e7900f..9f16956e0 100644
--- a/grub-core/commands/sleep.c
+++ b/grub-core/commands/sleep.c
@@ -51,12 +51,16 @@ static int
 grub_interruptible_millisleep (grub_uint32_t ms)
 {
   grub_uint64_t start;
+  int key;
 
   start = grub_get_time_ms ();
 
-  while (grub_get_time_ms () - start < ms)
-if (grub_getkey_noblock () == GRUB_TERM_ESC)
+  while (grub_get_time_ms () - start < ms) {
+key = grub_getkey_noblock ();
+/* ESC sometimes is the BIOS setup hotkey, also allow F8 as intr. */
+if (key == GRUB_TERM_ESC || key == GRUB_TERM_KEY_F8)
   return 1;
+  }
 
   return 0;
 }
diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c
index e7a83c2d6..d813fade1 100644
--- a/grub-core/normal/menu.c
+++ b/grub-core/normal/menu.c
@@ -610,8 +610,8 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
  print_countdown (pos, timeout);
}
 
-  /* Enter interruptible sleep until Escape or a menu hotkey is pressed,
- or the timeout expires.  */
+  /* Sleep until a menu hotkey is pressed, we are interrupted by an ESC/F8
+ keypress, or the timeout expires. */
   saved_time = grub_get_time_ms ();
   while (1)
{
@@ -624,7 +624,8 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
  if (entry >= 0)
break;
}
- if (key == GRUB_TERM_ESC)
+ /* ESC sometimes is the BIOS setup hotkey, also allow F8 as intr. */
+ if (key == GRUB_TERM_ESC || key == GRUB_TERM_KEY_F8)
{
  timeout = -1;
  break;
-- 
2.17.0.rc1


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