AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How use Right Click to launch script ?

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Maxleouf
Guest





PostPosted: Tue Mar 02, 2010 12:36 pm    Post subject: How use Right Click to launch script ? Reply with quote

Hye I want to launch a script with the right click with my mouse for a game.


#MaxThreadsPerHotkey 3
é:: ; Win+Z hotkey.
#MaxThreadsPerHotkey 1
if KeepWinZRunning = y ; This means an underlying thread is already running the loop below.
{
KeepWinZRunning = ; Make it blank to signal that thread's loop to stop.
return ; End this thread so that the one underneath will resume and see the change.
}
; Otherwise:
KeepWinZRunning = y
Loop,
{

Send {f2}
Sleep 10
MouseClick, Left
Sleep 10


if KeepWinZRunning = ; The user signaled the loop to stop by pressing Win-Z again.
break ; Break out of this loop.
}
KeepWinZRunning = ; Reset in preparation for the next press of this hotkey.
return


This is my script and I want te change "é" by "right click" but I don't know what is the language to use right click in this program.
Thanks!
Sorry if my english is not good i'm not English.
Back to top
fred



Joined: 01 Feb 2010
Posts: 230
Location: Netherlands

PostPosted: Tue Mar 02, 2010 12:39 pm    Post subject: Reply with quote

RButton - the right mouse button
Back to top
View user's profile Send private message
Maxleouf
Guest





PostPosted: Tue Mar 02, 2010 5:09 pm    Post subject: Reply with quote

Thank you very much this is exactly what i want !!
Thanks you again lol
Back to top
Maxleouf
Guest





PostPosted: Fri Mar 19, 2010 4:29 pm    Post subject: Reply with quote

Hi again !
I have an other question, I want to lauch this program with 2 buttons
F1 and Left click of my mouse
Ex:
(F1 and Lbutton)::

Send a
sleep 100
Send b
sleep 100
send c
return

NB :
I want to have one seconde ore more to launch the program between the F1 and Left click.
Because the button F1 open a "pop-up" to choose a selection with LeftClick.

Thanks to help me !!
Back to top
HotKeyIt



Joined: 18 Jun 2008
Posts: 4652
Location: AHK Forum

PostPosted: Fri Mar 19, 2010 5:01 pm    Post subject: Reply with quote

Question
Code:
Lbutton::
If !GetKeyState("F1","P")
 Return
Send a
sleep 100
Send b
sleep 100
send c
return

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink


Last edited by HotKeyIt on Fri Mar 19, 2010 8:27 pm; edited 2 times in total
Back to top
View user's profile Send private message
Maxleouf
Guest





PostPosted: Fri Mar 19, 2010 6:51 pm    Post subject: Reply with quote

I have done a test but with your help, the Left click is blocked, or I must use the left click to move the character.

And the button F1 isn't affected in the program.
But Thank you really
Back to top
HotKeyIt



Joined: 18 Jun 2008
Posts: 4652
Location: AHK Forum

PostPosted: Fri Mar 19, 2010 8:30 pm    Post subject: Reply with quote

Sorry forgot ~ Embarassed
Code:
~Lbutton::
If !GetKeyState("F1","P")
 Return
Send a
sleep 100
Send b
sleep 100
send c
return
This may help Question
Code:
F1 & LButton::MsgBox
F1::Send {F1}

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
Maxleouf
Guest





PostPosted: Fri Mar 19, 2010 9:52 pm    Post subject: Reply with quote

Thanks that is works =D !
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group