Jump to content
Sign in to follow this  
bouncingmolar

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

Recommended Posts

bouncingmolar

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
Zisly

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
bouncingmolar

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
bouncingmolar

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.