Hello everyone,
I'm trying to have space bar to be entered only when mouse is clicked while Ctrl + r is pressed.
Here is my code, but whenever I have ^ in the GetKeyState, it doesn't seem to work.
Anybody knows a solution?
Lbutton::
if (GetKeyState("^r")) {
Send {Space}
return
}
else {
Send {Lbutton}
return
}
Combination of keys and mouse click
Re: Combination of keys and mouse click
Try calling GetKeyState for both Ctrl and R.
Code: Select all
If (GetKeyState("Ctrl") and GetKeyState("r")) {
Re: Combination of keys and mouse click
Thanks Osprey, but it didn't work. I'm thinking maybe I shouldn't use GetKeyState and use something else for this?
Re: Combination of keys and mouse click
This works:
It simply requires thinking of it slightly differently: as pressing Ctrl+LButton while 'r' is held down. If you add more hotkeys after that, though, make sure that you add #If on a line by itself to disable the 'r' key condition.
Code: Select all
#If GetKeyState("r")
^LButton::Send {Space}
Who is online
Users browsing this forum: Rohwedder and 267 guests