This is a feature a bit hidden/undocumented in AutoHotkey I have learned from Jack's blog post here:
https://jacksautohotkeyblog.wordpress.com/2019/12/30/use-autohotkey-gui-menu-bar-for-instant-hotkeys/
https://jacksautohotkeyblog.wordpress.com/2019/12/30/use-autohotkey-gui-menu-bar-for-instant-hotkeys/
When appended to the end of a MenuItemName, the tab character (`t) followed by one or more standard Hotkey modifiers (Ctrl, Alt, or Shift) plus another key “indicates a keyboard shortcut that the user may press instead of selecting the menu item. If the shortcut uses only the standard modifier key names Ctrl, Alt and Shift, it is automatically registered as a keyboard accelerator for the GUI.”I use this for example in a simple ListView Gui with checkboxes to be able to select all with Ctrl+A.
Menu, ItemsMenu, Add, Check All`tCtrl+A, SelectAll
Menu, ItemsMenu, Add, Uncheck all`tCtrl+Shift+A, UncheckAll
SelectAll:
LV_Modify(0, "Check") ; Uncheck all the checkboxes.
return
UncheckAll:
LV_Modify(0, "-Check") ; Uncheck all the checkboxes.
return
No comments:
Post a Comment