Sign in to follow this  
Followers 0
Christopher Blue

Sending modified mouse clicks.

9 posts in this topic

I am trying to send a mouse click with a modifier key (ctrl, alt, shift, etc.) held down but using Send("{modkey down}") doesn't seem to be working.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

;~ VK_BACK (08)
;~     BACKSPACE key

;~ VK_TAB (09)
;~     TAB key

;~ VK_CLEAR (0C)
;~     CLEAR key

;~ VK_RETURN (0D)
;~     ENTER key

;~ VK_SHIFT (10)
;~     SHIFT key

;~ VK_CONTROL (11)
;~     CTRL key

;~ VK_MENU (12)
;~     ALT key

;~ VK_PAUSE (13)
;~     PAUSE key

;~ VK_CAPITAL (14)
;~     CAPS LOCK key

#include <Misc.au3>

While 1
    If _IsPressed("11") Then Clickity() ; Ctrl is pressed
    If _IsPressed("1B") Then Quit()
WEnd

Func Clickity()
    MouseClick("left")
EndFunc

Func Quit()
    Exit
EndFunc

Edited by gamepin126

Share this post


Link to post
Share on other sites

So I should use Send("{ctrl down}") then use that code to wait for it to take effect?

Share this post


Link to post
Share on other sites

If you hold it down it'll be pressed repeatedly, or do you want it to be able to click and hold click?

Share this post


Link to post
Share on other sites

Basically I want to ctrl-left click the screen. Like if I held down ctrl and clicked the left mouse button.

Share this post


Link to post
Share on other sites

I'm guessing this should work

Send("{CTRLDOWN}")
MouseClick("left", 0, 0)
Send("{CTRLUP}")

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Hm, I have been trying Send("{CTRL down}") and Send("{CTRL up}"). I will try what you put, emperor.

Edited by Christopher Blue

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Strange it works for me when I use {CTRLDOWN} and {CTRLUP} but not when I use {CTRL DOWN} and {CTRL UP}.

Edited by Emperor

Share this post


Link to post
Share on other sites

Aye, me too. But CTRLDOWN and CTRLUP work! Thanks, Emperor.

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