Global Hotkey support
In addition to defining a menu entry hotkey by using a .txt file, you can define global hotkeys in the MyE2B.cfg file which will act on all menus.
As soon as the user presses a hotkey (e.g. presses the F4 key) in any menu, the command assigned to the F4 hotkey will immediately run.
Some examples can be found in the \_ISO\Sample_MyE2B.cfg files.
Avoid using SHIFT+ P, C, E or B for hotkeys as these are used by grub4dos for password entry and editing, etc.
Also, for global hotkeys it is also best to avoid using the CTRL key (e.g. don't use CTRL+F4 to run an ISO from a hotkey because the Ctrl key may modify the behaviour of the ISO when it runs - e.g. some linux ISOs).
Note: Not all key combinations can be used as the keyboard does not generate a scan code for certain combinations (e.g. Ctrl+3). See here for a list.
Run any .iso or payload file from a hotkey
For instance, set up the F11 hotkey to always run a the Ubuntu Live ISO (or any ISO file) from any menu, by adding the line below to your \_ISO\MyE2B.cfg file:
(bd)/%grub%/hotkey [F11] "(bd)/%grub%/qrun.g4b force.isodefault (bd)/_ISO/MyUbuntu.iso ;; boot" > nul
Note that using F11 and F12 as hotkeys may not always work on some notebooks because the keyboard scan codes may vary! Using F1-F10 should be OK.
Global hotkeys do not use a menu entry and so are invisible to the user. If you want the user to know what they are, add text to the HELPTEXT variable in the MyE2B.cfg file or to your background bitmap. The hotkeys that you define will be active for all the menus. See \_ISO\docs\Templates\TextMinimal\MyE2B.cfg for an example.
Another example - press SHIFT+F2 to boot to Hirens:
(bd)/%grub%/hotkey [Shift+F2] "(bd)/%grub%/qrun.g4b (bd)/_ISO/Hirens.isowinvh ;; boot" > nul
When a hotkey is pressed, the commands will be executed. If you don't want any grub4dos messages to be displayed, precede the command list with @ - e.g.
(bd)/%grub%/hotkey [Shift+F2] "@(bd)/%grub%/qrun.g4b (bd)/_ISO/Hirens.isowinvh ;; boot" > nul
Run a .mnu file from a hotkey
Note for Advanced tweakers only!
Any global hotkey that is set, will exist for ALL menus and you cannot change or remove a hotkey command unless you add a new hotkey command to the top of a menu .hdr or .lst file so that it is executed when that menu loads or, you add a .mnu file that is loaded first (e.g. starts with $$$ so it is added before other payload and .mnu files)
For example: If you want F11 to automatically run Ubuntu when you are in the LINUX menu, but do not want the menu entry to be visible in the menu,
1. Create a \_ISO\LINUX\$$$HotkeyUbuntu.mnu file containing this single line of text:
(bd)/%grub%/hotkey [F11] "(bd)/%grub%/qrun.g4b force.isodefault /_ISO/MyUbuntu.iso ;; boot" > nul
2. Add your MyUbuntu.iso file to the \_ISO folder.
Note that once the Linux menu is loaded, the F11 hotkey will now work in every menu unless you redfine the hotkey or clear it. For instance, if you added (bd)/%grub%/hotkey [F11] > nul to a new .mnu file in the \_ISO\$$$$CONFIG folder, then when the Main menu was loaded, the F11 hotkey would be cleared.
Tip: You can define a global hotkey in the \_ISO\MyE2B.cfg file which will work in all menus.