This is the XIMCommander with a few lines of code put in to make your right click toggle, so in games with ADS like CoD you can Toggle in and out of Aim Down Sights instead of having to hold it.
Since it's actually toggling the right click signal going from the computer to the XIM, it's as if you held the left trigger down through death, so the primary/secondary sensitiviites aren't an issue like they are in the NOM4D method.
Anyway, if you want to put it into your current XIMCommander build just put these lines into XIMCommander.cpp (if you're not compiling your own just skip to the bottom):
First, in the global variables section (under the comment "Globals") add these global variables
bool IsToggled = false;
bool IsHeldDown = false;
Then in UpdateInput replace this line (the second one in "// Mouse -> XIM Input State.")
if (Mouse.rgbButtons[1]) mouseInput.Buttons[XIMMouseInput::ButtonRight] = ButtonPressed;
with this
// Right Mouse Click Toggle, for e.g. Toggle Aim Down Sight in Call of Duty
if (Mouse.rgbButtons[1])
{
if(!IsHeldDown)
{
if(!IsToggled)
{
IsToggled = true;
}
else
{
IsToggled = false;
}
IsHeldDown = true;
}
}
else
{
IsHeldDown = false;
}
if(IsToggled) mouseInput.Buttons[XIMMouseInput::ButtonRight] = ButtonPressed;
// End Right Mouse Click Toggle
If you'd like to use a button other than Right Click, you can replace a different line and replace the last line of the replacing code to whatever button you want. If you use the pre-compiled executable though you're stuck with Right Click, sorry

Here is executable with source:
http://home.mindspring.com/~duckreconmajor/XIMBridgeToggleADS.zipor
http://www.mediafire.com/?i61mxdtf8xtbtcb