Jump to content

Recommended Posts

Posted (edited)

Hi all,

i am having problems making a script that manipulates my mouse click input when i hold the "control" key down, so the program sends

the right mouse click. i need to do this as i have got one of those apple mice that only have one button on them.any help would be appreciated.

Many thanks

Edited by hodro
  • Moderators
Posted

hodro,

Welcome to the AutoIt forum. :)

You can do it like this: ;)

#include <Misc.au3>

; Press ESC to exit
HotKeySet("{ESC}", "On_Exit")

Local $hDLL = DllOpen("user32.dll")

While 1

    ; If Ctrl is pressed at the same time as the Left mouse button
    If _IsPressed("11", $hDLL) And _IsPressed("01", $hDLL) Then
        ; Right click the mouse
        MouseClick("secondary")
    EndIf
    Sleep(10) ; Needed to prevent teh CPU overloading

WEnd

Func On_Exit()
    DllClose($hDLL)
    Exit
EndFunc

But I really think you ought to buy a 2-button mouse! :D

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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:

  Reveal hidden contents

 

  • Moderators
Posted

hodro,

My pleasure. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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:

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

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