I want to remap mouse-up and mouse-down to keyboard keys, but only while using a certain application. This is how far I got:
_WinWaitActivate("League of Legends (TM) Client", "")
HotKeySet("{K}", "WinTab")
ProcessWait("")
Func WinTab()
Send("G")
EndFunc
#region --- Internal functions Au3Recorder Start ---
Func _WinWaitActivate($title, $text, $timeout=0)
WinWait($title, $text, $timeout)
If Not WinActive($title, $text) Then WinActivate($title, $text)
WinWaitActive($title, $text, $timeout)
EndFunc
#endregion --- Internal functions Au3Recorder End ---
This would remap K to G. It's possible to remap the mouse wheel as well, but I could not find the appropriate keybinding. I also want to pause the remapping if Esc is pressed or Alt + Tab for example.
You cannot bind mouse actions using
HotKeySet
, as that is only for keyboards.Instead there are several options:
_IsPressed
). This has been done before in both simple forms and more complex.The second part has been done thousands of times... Search for it :)
Use: