One key with two functions
One key with two functions
I am wanting to make one key do two things. For example if I hit the X key on the keyboard, is it possible to make a script that uses the X key as normal then additionally can add a left mouse click. For an example say I’m playing a FPS and X is my zoom and left click is my fire. The script I am wondering if possible would allow you to press X which would zoom then instantly fire making quick scopes possible with one key press.
Re: One key with two functions
Hi, Try this
x presses x ,Click
x presses x ,Click
Code: Select all
$x::SendInput, x{Click}
Last edited by Sashkon on 01 Aug 2019, 15:31, edited 3 times in total.
Re: One key with two functions
Another example:
Code: Select all
~x::Click
Re: One key with two functions
Thanks. I will give this a try as soon as I get home.
Re: One key with two functions
If I wanted three different keys to do the same thing would I just make a script like this
~x::Click
~c::Click
~v::Click
All in one script?
~x::Click
~c::Click
~v::Click
All in one script?
Re: One key with two functions
This doesn't work for quickscope, because click first then x
Re: One key with two functions
Yes, Do all hotkeys in one file.
and add #IfWinActive so your keys will active only when they needed.
Code: Select all
#IfWinActive, ahk_exe game.exe
$x::SendInput, x{Click}
$c::SendInput, c{Click}
$v::SendInput, v{Click}
#IfWinActive
Last edited by Sashkon on 01 Aug 2019, 22:25, edited 4 times in total.
Re: One key with two functions
It works but here’s an issue. If I hit it it works one time. Then if I let off and hit it again it will repeatedly work without letting off. Anyway to make it do so on the first click?
Re: One key with two functions
I need a loop when I hold a key down. Is this possible?
Re: One key with two functions
You can press x and on key up - press click
Code: Select all
$x::
SendInput, x
KeyWait, x
SendInput, {Click}
return
Re: One key with two functions
This will make it click when letting off of x?Sashkon wrote: ↑01 Aug 2019, 22:30You can press x and on key up - press clickCode: Select all
$x:: SendInput, x KeyWait, x SendInput, {Click} return
Who is online
Users browsing this forum: -Garfle-, Mindfork, Rohwedder, TarDragoon and 105 guests