I am rather new to AutoHotKey, so please bear with any idiocy on my part, but I am trying to use at least one of my two mouse buttons (I have a Logitech M570 trackball and am running Windows 10) to perform basically the same function as a prefix key. I just basically want another key that can function like ctrl, alt, windows, fn, etc. I have been attempting to do this on a hotkey-by-hotkey basis, as opposed to just remapping the key itself (I don't want to lose any of the existing shortcuts based on the other prefixes) but for some reason, it doesn't ever work. I don't know if it's something in my trackball settings, or if it's something in AutoHotKey. Here is an example of what I have been trying to do
XButton1 & a::Left
XButton1 & d::Right
XButton1 & w::Up
XButton1 & s::Down
Which is supposed to turn a w s d
into the arrow keys while I hold XButton1
down.
If anybody has any suggestions on how to resolve this, I would greatly appreciate it.
UPDATE: There is nothing at all wrong with my code. The problem is my trackball. Do not attempt to use a Logitech M570 with AutoHotKey, it is quite aggravating.
HOWEVER, as is noted in the accepted answer, this script will render the key used in the remap useless, so don't adapt this using your LButton
instead of XButton1
. See the aforementioned answer for a better way to accomplish the same goal.
XButton1 & a::Send {Left}
. See also Custom Combinations. – user3419297XButton1
withKeyHistory
. If it does check with a script that has only those 4 lines and when it's the only script running. – OlegKeyHistory
but neither seem to behave well inCustom Combinations
. I have gotten them to run just fine when the mouse button is the only key used when firing the hotkey (a.k.a. key remapping). Thanks for your assistance. – ThePiggy