Sign in to follow this  
Followers 0
JimmyN

Converting from AHK

5 posts in this topic

I'm converting some AHK scripts over.  How would I handle this:

MButton::
Send ^!c
return
 
Thanks...Jimbo

Share this post


Link to post
Share on other sites



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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Welcome Jimbo,

so tell us you did try first to have a look yourself before posting this rather simple question? ;)

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
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...

Share this post


Link to post
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
Sign in to follow this  
Followers 0