Hello!
so i want to create a script that does 2 things:
the first one being the spacebar becomes the left mouse button
and when i double click the spacebar it becomes as if i'm pressing both the left mouse button and the M key at the same time and when i double click again it turns back to only the left mouse button
so:
spacebar > becomes left mouse button > doubleclick > becomes left mouse button + the M key> doubleclick again > back to only left mouse button
and the second part similar to the first one in which the Alt key this time is now the right mouse button but this time when i press the P key the Alt key becomes as if i'm pressing both the right mouse button and the H key at the same time and when i press the P key again the Alt key turns back to only the right key button
so:
Alt key> becomes right mouse button > press P key > becomes right mouse button + the H key > press P key again > back to only right mouse button
and that's all! hopefully i didnt do a bad job explaining it and thank you in advance! :DDD
How do i make a key do 2 different things? help! Topic is solved
Re: How do i make a key do 2 different things? help! Topic is solved
Welcome to this AutoHotkey forum!
Part 2 gets harder: your shot at it!
Code: Select all
Space::
If !Ts
SetTimer, Ts, -300
Ts++
Return
Ts:
If GetKeyState("Space", "P") || Ts = 1 {
If both {
Send {LButton down}{m down}
SoundBeep, 1500
KeyWait, Space
Send {m up}{LButton up}
SoundBeep, 1000
} Else {
Click, D
KeyWait, Space
Click, U
}
} Else {
both := !both
SoundBeep, 1000 + 500 * both
}
Ts =
Return
Re: How do i make a key do 2 different things? help!
Thank youuuu very much sir! i kinda felt a bit guilty for just asking for a finished script from the start without even trying to make my own first, really really really appreciate it and i will definitely do my best to give the second part a shot and keep you updated, again really thanks a lot and have a nice day!mikeyww wrote: ↑18 May 2022, 19:48Welcome to this AutoHotkey forum!
Part 2 gets harder: your shot at it!Code: Select all
Space:: If !Ts SetTimer, Ts, -300 Ts++ Return Ts: If GetKeyState("Space", "P") || Ts = 1 { If both { Send {LButton down}{m down} SoundBeep, 1500 KeyWait, Space Send {m up}{LButton up} SoundBeep, 1000 } Else { Click, D KeyWait, Space Click, U } } Else { both := !both SoundBeep, 1000 + 500 * both } Ts = Return