Hold and release

Ask gaming related questions
Mojisho
Posts: 2
Joined: 22 Mar 2024, 11:12

Hold and release

Post by Mojisho » 22 Mar 2024, 11:30

Hi guys
I need some code that hold down R Bottom when i press L Bottom of mouse and when i release L Bottom first single press the L bottom and then release R bottom that was holded like when sniping in some game for every sniper shot just hold left click for zoom and release for shot sry for bad English btw


[Mod edit: Moved topic from 'Forum Issues'. Let's assume it's a v2 question.]

User avatar
mikeyww
Posts: 27366
Joined: 09 Sep 2014, 18:38

Re: Hold and release

Post by mikeyww » 22 Mar 2024, 19:53

Welcome to this AutoHotkey forum!

Code: Select all

#Requires AutoHotkey v2.0

LButton:: {
 Click 'R D'
 SoundBeep 1500
 KeyWait ThisHotkey
 Click
 Click 'R U'
 SoundBeep 1000
}

Mojisho
Posts: 2
Joined: 22 Mar 2024, 11:12

Re: Hold and release

Post by Mojisho » 23 Mar 2024, 05:28

mikeyww wrote:
22 Mar 2024, 19:53
Welcome to this AutoHotkey forum!

Code: Select all

#Requires AutoHotkey v2.0

LButton:: {
 Click 'R D'
 SoundBeep 1500
 KeyWait ThisHotkey
 Click
 Click 'R U'
 SoundBeep 1000
}
tnx for responding but there is a little problem , it's shot when i press the LB but i need to shot when LB released i mean " hold LB = zoom " and " when LB released = shot "

User avatar
mikeyww
Posts: 27366
Joined: 09 Sep 2014, 18:38

Re: Hold and release

Post by mikeyww » 23 Mar 2024, 06:08

What the script does:
Hold down R Bottom when i press L Bottom
To define a hotkey that is activated upon release of a key or button, the :arrow: UP hotkey modifier can be used.

A bottom could be a button somewhere else, but not in AutoHotkey!

See the KeyHistory to learn what is happening with your keys.

Post Reply

Return to “Gaming”