XIM Community

XIMCommander with Toggle ADS  (Read 2862 times)

Offline DuckReconMajor

  • Member
  • *
  • Posts: 204
    • View Profile
  • Gamertag: DuckReconMajor
  • PSN ID: DuckReconMajor
XIMCommander with Toggle ADS
« on: 10:07 PM - 04/04/12 »
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

Code: [Select]
bool IsToggled = false;
bool IsHeldDown = false;

Then in UpdateInput replace this line (the second one in "// Mouse -> XIM Input State.")

Code: [Select]
if (Mouse.rgbButtons[1]) mouseInput.Buttons[XIMMouseInput::ButtonRight]   = ButtonPressed;
with this

Code: [Select]
// 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.zip
or
http://www.mediafire.com/?i61mxdtf8xtbtcb

Offline sandak

  • Member
  • *
  • Posts: 407
    • View Profile
  • Gamertag: msutome
Re: XIMCommander with Toggle ADS
« Reply #1 on: 07:31 AM - 04/05/12 »
Thanks a lot for this. I'll be checking this out tonight.

Offline chewz

  • Member
  • *
  • Posts: 176
    • View Profile
Re: XIMCommander with Toggle ADS
« Reply #2 on: 11:25 AM - 12/28/12 »
It works as he states, except I cannot get rid of the horrendous input lag it causes when using xim commander. How do people use xim commander happily, I've tried different mice and it all feels laggy and off.  Is there some kind of fix for this? It would save me going out to buy a xim3 again, but just feels so sloppy/laggy

Offline DuckReconMajor

  • Member
  • *
  • Posts: 204
    • View Profile
  • Gamertag: DuckReconMajor
  • PSN ID: DuckReconMajor
Re: XIMCommander with Toggle ADS
« Reply #3 on: 05:15 PM - 12/28/12 »
I had the issue where the number would spike and the inputs would be dropped so I quit using xim commander after like a week. I may try it again when I get a new computer.