hotkey - Printable Version +- Ventoy Forums (https://forums.ventoy.net) +-- Forum: Ventoy Plugin —— Ventoy 插件 (https://forums.ventoy.net/forumdisplay.php?fid=3) +--- Forum: Ventoy Plugin Forum (https://forums.ventoy.net/forumdisplay.php?fid=4) +--- Thread: hotkey (/showthread.php?tid=2360) |
hotkey - hyun9358 - 01-23-2023 I want to make the power on and off function work directly with F11 and F12. How do I use a hotkey? RE: hotkey - nguyen ha thai trong - 01-23-2023 (01-23-2023, 06:02 AM)hyun9358 Wrote: I want to make the power on and off function work directly with F11 and F12. How do I use a hotkey?elif [ "$vtHotkey" = "F6" ]; then ventoy_ext_menu elif [ "$vtHotkey" = "F11" ]; then sleep 1 reboot elif [ "$vtHotkey" = "F12" ]; then sleep 1 halt fi RE: hotkey - serhat100 - 01-23-2023 (01-23-2023, 06:09 PM)nguyen ha thai trong Wrote:F8 and later keys are disabled. unfortunately these commands don't work that way.(01-23-2023, 06:02 AM)hyun9358 Wrote: I want to make the power on and off function work directly with F11 and F12. How do I use a hotkey?elif [ "$vtHotkey" = "F6" ]; then RE: hotkey - hyun9358 - 01-23-2023 (01-23-2023, 06:09 PM)nguyen ha thai trong Wrote:(01-23-2023, 06:02 AM)hyun9358 Wrote: I want to make the power on and off function work directly with F11 and F12. How do I use a hotkey?elif [ "$vtHotkey" = "F6" ]; then RE: hotkey - nguyen ha thai trong - 01-24-2023 This problem must be longpanda, the command lines you and I mentioned in grub.cfg have no effect on the F1-9 keys, let alone F11, F12. Try deleting the block #special VTOY_DEFAULT_IMAGE process if [ -n "$VTOY_DEFAULT_IMAGE" ]; then if regexp --set 1:vtHotkey --set 2:vtDefault "(F[2-9])>(.*)" "$VTOY_DEFAULT_IMAGE"; then set default="$vtDefault" if [ -z "$VTOY_MENU_TIMEOUT" ]; then set timeout=0 else set timeout=$VTOY_MENU_TIMEOUT fi export timeout export default vt_fn_mutex_lock 1 if [ "$vtHotkey" = "F2" ]; then unset timeout vt_browser_disk elif [ "$vtHotkey" = "F4" ]; then ventoy_localboot elif [ "$vtHotkey" = "F5" ]; then ventoy_diagnosis elif [ "$vtHotkey" = "F6" ]; then ventoy_ext_menu fi vt_fn_mutex_lock 0 unset timeout unset default fi fi Then try pressing the F1-9 keys, it still works. The above command block (as longpanda wrote) it only serves #special VTOY_DEFAULT_IMAGE process RE: hotkey - AlexBryansk - 01-25-2023 currently, the f11 and f12 buttons are not working. But this can be done with different spomobs: 1. Make changes to longpanda. 2. Change menu.c yourself and compile. 3. I can add to my mod_Ventoy, but then I will have to use something other than the original. 4. Abandon f11 and f12. And to do as it was in the early versions of ventoy (somewhere before 1.0.67), the power menu was called by f2. And add ventoy- browers to the main menu. All changes of clause 4 in grub.conf. submenu " ventoy browser" --class=iconFM { if [ "$VTOY_THEME_FMV" != "" ]; then if [ -f ${vt_plugin_path}${VTOY_THEME_FMV} ]; then set theme=${vt_plugin_path}${VTOY_THEME_FMV} fi fi unset timeout set VTOY_MENU_TIP_ENABLE=0 vt_browser_disk } ...... if [ "$vtHotkey" = "F2" ]; then ventoy_power elif [ "$vtHotkey" = "F4" ]; then ventoy_localboot elif [ "$vtHotkey" = "F5" ]; then ventoy_diagnosis elif [ "$vtHotkey" = "F6" ]; then ventoy_ext_menu elif [ "$vtHotkey" = "F9" ]; then ventoy_info fi vt_fn_mutex_lock 0 unset timeout unset default fi fi You can see the implementation of clause 4 in mod_ventoy 1.0.80 RE: hotkey - hyun9358 - 01-25-2023 (01-25-2023, 03:27 AM)AlexBryansk Wrote: currently, the f11 and f12 buttons are not working. But this can be done with different spomobs: ================================================================ Can't we add this feature in the next version? I wish it was added. |