One right click to hold itself, another to release (hold ADS into toggle ADS)

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
musiicy
Posts: 3
Joined: 27 Jul 2017, 11:21

One right click to hold itself, another to release (hold ADS into toggle ADS)

27 Jul 2017, 11:59

Hi,

I'm very unsure about two things:
1) if my title makes sense to someone
2) if that is doable at all

Context is: I play a shooter game called Paladins. 2 characters from the game have the ability to aim down sights.
In most FPS games, you generally have the choice to either:
- right-click once to scope in, then once again to scope out (referred as toggle ADS)
- or hold the right click to scope in, and release it to scope out (referred as hold ADS)
Here lies my problem: I'm used to toggle ADS, unfortunately the Paladins' devs did not give us the choice (yet) meaning I have to hold the right-click to stay scoped-in, which has always left me a much more inaccurate player.

---

Now my wonder is:
Can you write a script that, upon physically right-clicking once, will hold it down until physically right-clicking another time ? (and would indefinetely alternate like so ?)

Main issue is being able to differ the physical use of the button from the desired emulation of it being held down.
Maybe is there something to do with the GetKeyState physical/logical state options ?

I'm quite new at scripting with AHK, and until now I've always struggled with using either KeyWait or GetKeyState; it usually gets worse as I use them inside a loop with if conditions.

---

Thanks a lot in advance if anyone manages to figure this out !
kab7005
Posts: 3
Joined: 26 Sep 2017, 09:01

Re: One right click to hold itself, another to release (hold ADS into toggle ADS)

26 Sep 2017, 09:17

Ok, I play too, here is the code I'd use (Untested):

Code: Select all

~RButton::
	SLEEP 20
	Send, {RButton down}
	
~LButton::
	SLEEP 20
	Send, {RButton up}

~^::
	SLEEP 20
	Send, {RButton up}

Esc::
ExitApp
	
So,
Click right Mouse button to hold it down
Press control to get out of zoom
Or shoot..
Press ESC to exit

I hope you know how to use ahk...
Your Welcome, let me know if it works
kab7005
Posts: 3
Joined: 26 Sep 2017, 09:01

Re: One right click to hold itself, another to release (hold ADS into toggle ADS)

26 Sep 2017, 09:17

Ok, I play too, here is the code I'd use (Untested):

Code: Select all

~RButton::
	SLEEP 20
	Send, {RButton down}
	
~LButton::
	SLEEP 20
	Send, {RButton up}

~^::
	SLEEP 20
	Send, {RButton up}

Esc::
ExitApp
	
So,
Click right Mouse button to hold it down
Press control to get out of zoom
Or shoot..
Press ESC to exit

I hope you know how to use ahk...
Your Welcome, let me know if it works
kab7005
Posts: 3
Joined: 26 Sep 2017, 09:01

Re: One right click to hold itself, another to release (hold ADS into toggle ADS)

26 Sep 2017, 09:17

Ok, I play too, here is the code I'd use (Untested):

Code: Select all

~RButton::
	SLEEP 20
	Send, {RButton down}
	
~LButton::
	SLEEP 20
	Send, {RButton up}

~^::
	SLEEP 20
	Send, {RButton up}

Esc::
ExitApp
	
So,
Click right Mouse button to hold it down
Press control to get out of zoom
Or shoot..
Press ESC to exit

I hope you know how to use ahk...
Your Welcome, let me know if it works

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Rohwedder and 146 guests