On 27.02.2012 00:08, Andreas Born wrote:
Attached patch introduces a new environment variable hotkey_action. It can be set to select or execute, whereas the latter is the default. So the default behaviour doesn't change. With select set instead a menu entry is just selected and not executed/booted on hotkey press.

This is for example useful for long menus to directly jump to some initial and afterwards select the desired entry without going through the whole menu. One still has to explicitly mark the menu entry to jump to with the hotkey attribute. This patch only allows to change the action to take on hotkey press.

Not much code and most is inspired from grub_menu_get_timeout. Applies and works with r3991.

    Add support to the menu for changing the action on hotkey press:
    execute (default), select

    * grub-core/normal/menu.c (DEFAULT_HOTKEY_ACTION): New define.
This is a global change (affecting all menuentries) for a local goal (have a jump hotkey for a menuentry). This has a drawback of making simultaneous inclusion of two files with different behaviour problematic. This should be implemented as a separate --jump-hotkey with additional benefit of allowing both hotkey and jump hotkey at the same time.
    (run_menu): Handle hotkey_action.
    (grub_menu_get_hotkey_action): New function.
    * include/grub/menu.h (grub_menu_get_hotkey_action): New prototype.
    (grub_hotkey_action_type_t): New enum.


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


--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko


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

Reply via email to