Code: Select all
1::send a
2::send b
Code: Select all
1::send a
2::send b
Code: Select all
thread1:=AhkThread("1::send a")
2::send b
It seems I am only able to trigger 1 and 2 simultaneously if I press them both at the exact same time. This is fairly hard to achieve because pressing one of them just slightly earlier will result in only 1 hotkey triggering. Is this something that can be addressed without combining 1 and 2 with &?HotKeyIt wrote: ↑06 Jan 2021, 22:38You will have to run in separate threads:Code: Select all
thread1:=AhkThread("1::send a") 2::send b
I think my problem is with how Windows sends key presses rather than with AHK or multithreading. If you press 1 then 2 not simultaneously and hold both keys, Windows will send this
Code: Select all
thread1:=AhkThread("
(
#MaxThreadsPerHotkey 1
1::
While GetKeyState(""1"",""P"")
send a
Return
)")
#MaxThreadsPerHotkey 1
2::
While GetKeyState("2","P")
send b
Return
Do you know why in the case below holding 1 and 2 simultaneously results in zigzag movement rather than smooth diagonal movement?HotKeyIt wrote: ↑07 Jan 2021, 07:56If you need that, you can do it like this:Code: Select all
thread1:=AhkThread(" ( #MaxThreadsPerHotkey 1 1:: While GetKeyState(""1"",""P"") send a Return )") #MaxThreadsPerHotkey 1 2:: While GetKeyState("2","P") send b Return
Code: Select all
thread1:=AhkThread("
(
#MaxThreadsPerHotkey 1
CoordMode, Mouse, Screen
SendMode Input
1::
While GetKeyState(""1"",""P"")
MouseMove, 10,0,, R
Return
)")
#MaxThreadsPerHotkey 1
CoordMode, Mouse, Screen
SendMode Input
2::
While GetKeyState("2","P")
MouseMove, 0,10,, R
Return