I want to set a hotkey that disables only mouse movement (both axis simultaneously), but only while that hotkey is being held down. When that hotkey is let go, mouse movement resumes. I want this to work in War Thunder, so that I can map that hotkey to a button on my Logitech G600 mouse so that I don't have to lift the mouse off of the surface of the table to relocate it. It's a heavy, touchy mouse, and the act of modifying my grip to lift it from the table changes my finger position just enough to be a pain in the ass. Hence why I would prefer to map a hotkey to disable movement input while I slide the mouse across the table, basically emulating lift-off without having to lift the mouse.
This is what I've got. I'm using F13 because it's an easy hotkey variable with no other key mappings. This script works in Explorer, which is nice insofar as it means I'm not completely inept, but it DOESN'T work inside of War Thunder, which is my next big hurdle to grasp here, and I guess where I'm hoping your suggestions might come in handy.
Code: Select all
^Esc::ExitApp
#If GetKeyState("F13", "T")
F13::BlockInput, MouseMove
return
#If GetKeyState("F13", "T")
F13 Up::BlockInput, MouseMoveOff
return
Aside from the kill command I can't claim to fully understand it, though. "If F13 is toggled down, block mouse movement, return. If F13 is toggled up, unblock mouse movement, return"? Intuitively it would seem that "BlockInputOff, MouseMove" would make more sense syntactically, no? So what's the deal with the "off" suffix on "MouseMove"? It disables the hyperlink to the official doc, so I have to assume there's some sort of morphological aspect to AHK coding that I've yet to encounter that also breaks the forum's auto hotlink functionality? Or am I completely off-base here?
The last time I coded anything was ten years ago and in SuperCollider, so forgive my ineptitude. I'll be reacquainting myself with the basics of coding in short order, but for now all I can do is ask for your leniency.
Any advice would be swell as I continue trawling previous posts and the official docs. Thanks.
[Mod action: Moved topic to v1 section. The main section is for v2.]