views:

4020

answers:

5

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)?

+2  A: 

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.

John T
This is awesome. Had to post to the AHK Forums to get the correct syntax. see: http://www.autohotkey.com/forum/viewtopic.php?t=41375
tyndall
If you compile the scripts to executables, does that mean you can distribute "your" AHKs to someone who doesn't have AHK installed?
tyndall
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 T
A: 

You could also turn on Accessibility MouseKeys via the Accessibility Options

benPearce
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.
tyndall
A: 

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).

A: 

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.

A: 

it allows drag and drop

kickmyass