As a fan of World Of Warcraft game I recently went shoping for mouse with extra buttons. The idea was that binding extra spells in game to those buttons will radically improve my reaction times. Such was the theory. But as I unpacked my brand new mouse and started so called mouse configuration panel i found out that only 2 of additional 6 extra buttons were programmable . And even those 2 had just limited assignable functionality such as "start email client" etc. Errrr
But I am curious person and i started to study this driver software. Soon i discovered that majority of the cheap mouses use the same drivers. So if you see KMProcess running you are a lucky guy. By launching usefull microsoft Spy++ I also soon found out that for each extra mouse button pressed this universal mouse driver generates custom WM_USER based message. So the idea was to capture those messages and react by emulating driver level keyboard imput so those buttons will be seen as regullar bindable keyboard buttons to games.
If you don't have KMProcess running don't worry. There is second and what is more important vendor / driver independent method. I will add code sample for this method soon so stay in touch
Using the code
The code for KMProcess method itself is very simple. It captures the internal custom mouse button mesages and translates it to F1-F6 key presses. But nothing holds you from lets-say executing whatever different action you wish. You can even simulate mouse movements or multiple key sequences to games by using function SendInput() instead of used keybd_event()
#include <span class="code-keyword"><windows.h></span>
Points of Interest
Just build dll in whatever developmnet environment you have copy it do windows dir and install it from Start->Run.. Dialog
rundll32 hook,inst KMProcess
or from command line
start rundll32 hook,inst KMProcess
where hook is the name of dll and KMProcess is the name of the mouse driver process
Also if you are a not programmer don't worry. Just extract included zip file and run bat file.
As soon as I will have time I will add second method plus version with some nice Gui allowing to record and play mouse and keyboard macros on any mouse button press.