protoid Posted October 22, 2009 Posted October 22, 2009 Easiest/fastest way to explain:press file or alt+fsee the shortcuts justified right on the menu items? there should be things like "New Tab_______Ctrl+T"Can you assign non-global hotkeys to functions or menu items like that natively in autoit?I searched a bit on the forums and was not able to find much on the topic...
Mat Posted October 22, 2009 Posted October 22, 2009 accelarators!! ; A simple dialog showing accelerators in menus #include <GUIConstantsEx.au3> GUICreate("Accelerators", 210, 80) $hRoot = GUICtrlCreateMenu ("&menu", -1) $hMenuItem1 = GUICtrlCreateMenuItem ("&New Tab" & @TAB & "Ctrl+T", $hRoot) $hMenuItem2 = GUICtrlCreateMEnuItem ("&Close Tab" & @TAB & "Ctrl+Y", $hRoot) $hMenuItem3 = GUICtrlCreateMenuItem ("&Exit" & @TAB & "Alt+F4", $hRoot) ; Set accelerators for Ctrl+t and Ctrl+y Dim $AccelKeys[2][2]=[["^t", $hMenuItem1], ["^y", $hMenuItem2]] GUISetAccelerators($AccelKeys) GUISetState() ; display the GUI Do $msg = GUIGetMsg() Switch $msg Case $hMenuItem1 MsgBox(0, "You clicked on", "Menu Item 1") Case $hMenuItem2 MsgBox(0, "You clicked on", "Menu Item 2") EndSwitch Until $msg = $GUI_EVENT_CLOSE Or $msg = $hMenuItem3 Mat AutoIt Project Listing
protoid Posted October 22, 2009 Author Posted October 22, 2009 Thank you! For the example and the name
picea892 Posted October 22, 2009 Posted October 22, 2009 http://www.autoitscript.com/forum/index.php?showtopic=100552&st=0&p=718934&hl=accelerator&fromsearch=1&#entry718934
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now