Sign in to follow this  
Followers 0
bouncingmolar

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

5 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



Try the operator NOT.

Share this post


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

Share this post


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

Share this post


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

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