JimmyN Posted October 18, 2014 Posted October 18, 2014 I'm converting some AHK scripts over. How would I handle this: MButton:: Send ^!c return Thanks...Jimbo
water Posted October 18, 2014 Posted October 18, 2014 Welcome to AutoIt and the forum! I assume this could be translated to AutoIt like this: Func MButton() Send("^!c") ; Send Ctrl-ALT-c Return EndFunc My UDFs and Tutorials: Reveal hidden contents UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Developers Jos Posted October 18, 2014 Developers Posted October 18, 2014 Welcome Jimbo, so tell us you did try first to have a look yourself before posting this rather simple question? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Solution Malkey Posted October 19, 2014 Solution Posted October 19, 2014 I am totally guessing when the AHK script is run, when the middle mouse button is pressed Ctrl-ALT-c keys are send to the active window. On this basis, this example is a modified copy of the example in the help file under the _IsPressed() function. Note: When the Esc key is pressed, the script exits. #include <Misc.au3> #include <MsgBoxConstants.au3> Local $hDLL = DllOpen("user32.dll") While 1 If _IsPressed("4", $hDLL) Then ; Middle mouse button ; Wait until key is released. While _IsPressed("10", $hDLL) Sleep(250) WEnd Send("^!c") ; Send Ctrl-ALT-c ElseIf _IsPressed("1B", $hDLL) Then ; Esc key MsgBox($MB_SYSTEMMODAL, "_IsPressed", "The Esc Key was pressed, therefore the application will close in 4 seconds.", 4) ExitLoop EndIf Sleep(250) WEnd DllClose($hDLL)
JimmyN Posted October 19, 2014 Author Posted October 19, 2014 Jos, I did do some digging before I posted. In general I don't ask, I it figure out. I guess I should have asked where in the docs/wiki/help would be clues on how to do this. I checked all of them, looking for a "re-mapping" kind of thing. Jimbo...
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