rophl Posted March 7, 2010 Share Posted March 7, 2010 (edited) Sorry if this question has been asked before, but how do I add a wrapper to the interpreter so I can change the syntax autoit accepts? Basically, I want autoit to treat {F2}:: {code and so on} the same as HotKeySet("{F2}",DummyFunc) Func DummyFunc() code and so on EndFunc Edited March 7, 2010 by rophl Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 7, 2010 Moderators Share Posted March 7, 2010 rophi, First, welcome to the AutoIt forum. You are not really saving a lot of typing in your example. Have you thought of using SciTE abbreviations to produce a template for your code? I use one such abbreviation to write a bunch of standard HotKeys with just 4 keystrokes. If you use the abbreviations cleverly, I would bet that they could reduce your typing as much as your projected wrapper. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
rophl Posted March 7, 2010 Author Share Posted March 7, 2010 thanks, these sort of work well enough to do what I wanted. Second question: is it all possible to bind a hotkey to something like Ctrl+MouseClick? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 7, 2010 Moderators Share Posted March 7, 2010 rophl,What have you tried?I would have thought this would do what you want:HotKeySet("a", "_My_Function") Func _My_Function() Send("{CTRLDOWN}") MouseClick{"primary") Send("CTRLUP}") EndFuncBut I have not tested it myself.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
rophl Posted March 7, 2010 Author Share Posted March 7, 2010 No I meant something like: HotKeySet("{LCTRL}"&"{MOUSECLICK}","FuncName") Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 7, 2010 Moderators Share Posted March 7, 2010 rophl,Search for the MouseOnEvent UDF - I think it was by MrCreator. That UDF, together with _IsPressed, should do what you want. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
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