Jump to content

How do I Detect Ctrl-MouseClick on a specific control.


Recommended Posts

I think I've finally figured out how to check if a user pushes Ctrl-Click... however it can't differentiate between ctrl-click and ctrl-alt-a-b-c-d-....-click.

I'd like to only activate the ctrl-Click function only when a specific controlID is ctrl-clicked. Can someone point me in the right direction I can't seem to find it in the help and i must be searching the wrong stuff on the forum.

Thanks.

eg using madeup function: ControlWaitUserInput ($windowtitle, $ControlID, "{Control} + {Left Mouse Click}")

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    Sleep ( 250 )
    If _IsPressed("11", $dll) AND _IsPressed("01", $dll) Then
        msgbox (1, "ctrl click", "ctrl click")
        ExitLoop
    EndIf
WEnd
DllClose($dll)
Edited by bouncingmolar
Link to comment
Share on other sites

Maybe this, haven't tested.

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    Sleep ( 250 )
    If _IsPressed("11", $dll) AND _IsPressed("01", $dll)  And Not _IsPressed("12",$dll) And _IsPressed("11",$dll) Then
    msgbox (1, "ctrl click", "ctrl click")
    ExitLoop
    EndIf
WEnd
Link to comment
Share on other sites

Thanks Guys that works ok.

How do I get it only to activate when clicking a specific control (not ctrl but a window control) ie if ControlExists

If Clicked: {Ctrl} + ({mouse left} only on $ControlID) == Then

perform function

I've just reworded my original post slightly because I think I may have lead everyone off the topic. I actually would like to find out how to test whether a ctrl-click has occurred when clicking only a specific controlID. Thanks for the help so far, it was very useful anyhow :P

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