Is the a programmatic way (or something more simple) to map some keyboard key to the same action windows-wide as the left mouse button in Windows XP / Vista. If programmatic is there a way to do this in .NET 2.0 (or greater)?
4 Answers
There is a programmatic way, and it is possible in C# with a global hook. But I find tools like AutoHotkey, which were made for this sort of thing, are much quicker to get up and running. The scripts can also be compiled to executables.
-
2This is awesome. Had to post to the AHK Forums to get the correct syntax. see: autohotkey.com/forum/viewtopic.php?t=41375– BuddyJoeFeb 25, 2009 at 14:40
-
If you compile the scripts to executables, does that mean you can distribute "your" AHKs to someone who doesn't have AHK installed?– BuddyJoeFeb 25, 2009 at 14:44
-
yes, that's exactly what the compiler's for. From the front page - "Convert any script into an EXE file that can be run on computers that don't have AutoHotkey installed."– John TFeb 25, 2009 at 17:46
You could also turn on Accessibility MouseKeys via the Accessibility Options
-
is it me? I turned this ON on Windows Vista and couldn't figure out how to make it do anything different. with the num lock on and off.– BuddyJoeFeb 25, 2009 at 14:37
-
This is the best option, it's built in, intended for this very thing and works great. Once it is activated,
ALT + SHIFT + NUMLOCK
turns it on & off,5
is left click,0
is hold left (press5
to stop holding),*
switches to right click,/
switches back– AFOCAug 27, 2021 at 16:02
What is "Accessibility MouseKeys".
In my Windows XP SP2, I don't have that option in the "Accessibility Options".
I want to map a keyboard key press onto left mouse-button DOUBLE-CLICK and am looking for very simple tools or control panel extensions to do that and map key presses onto single mouse clicks too... (looking at Autohotkey, but can't see how to do double click yet).
Mouse keys is a useless feature. First of all, while it emulates mouse movement, it doesn't allow right-clicking, and the ability to drag and drop instead of simply click doesn't function at all in my copy of XP. Also, you're limited to using the 5 numpad key for clicking (and supposedly the insert/delete keys, which aside from being far enough away from the num 5 to be a pain in the ass, are terrible keys to assign those functions to) which isn't at all convenient for a righty like me. And not to make a problem even more frustrating, even though its one word, "mousekeys" in all the windows literature, to find the drag/drop help article in their pathetic index requires searching for "mouse keys". Typical. I'm using Autohotkey, at least until I get Linux.