Jump to content

Converting from AHK


JimmyN
 Share

Go to solution Solved by Malkey,

Recommended Posts

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:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

  • Developers

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.
  :)

Link to comment
Share on other sites

  • Solution

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)
Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...