Pass Mouse Button Through Xim To Titan 2

Forum to discuss the scripts, configs and connection of XIM with the Titan devices.

Moderator: antithesis

Pass Mouse Button Through Xim To Titan 2

Postby trimps030 » Wed Aug 29, 2018 7:54 pm

Is it possible to pass a mouse (G502 plugged into the Xim 4) button that is set to send keyboard key O through to the Titan 2 and have the Titan 2 trigger an action when KEY_O is pressed? I have the script for KEY_O set up on the Titan 2 but when I press the mouse button that sends O it doesn't trigger the event?

If so, how would I go about doing this?

Thanks!
User avatar
trimps030
Corporal
Corporal
 
Posts: 5
Joined: Wed Aug 29, 2018 7:08 pm

Re: Pass Mouse Button Through Xim To Titan 2

Postby antithesis » Wed Aug 29, 2018 9:49 pm

Xims send only game input signals from buttons and sticks through to the T2, it's not possible to send unbound key or button presses.

To do what you want, plug the mouse & keyboard into Titan Two, then the T2 into the Xim. T2's Output Protocol needs to be set to USB Multi Interface HID.

You'll also need to add some code snippets to your script to allow m/kb passthrough.

Add this to the header -
Code: Select all
 
#include <keyboard.gph>
#include <mouse.gph>
 


Add this to main -
Code: Select all
 
mouse_passthru();
key_passthru();
 


I also think Joystick needs to be disabled for HID ouput, there's a checkbox for that in Gtuner.

An alternative is to leave your m/kb attached to PC and use the KMG Capture option in Gtuner via the PROG port on the T2. Again, T2 goes into Xim Apex's USB hub, USB Multi Interface HID etc, as per above.

Note that setting up your m/kb via T2 restricts mouse polling to 500Hz. That's not an issue though as we generally recommend for the most stable and compatible Xim setup to use 3-4K DPI and 500HZ polling. Set the Apex Response Rate to 500Hz too.

If I've got any of this wrong, feel free to correct me. I'm yet to use this setup myself, but plan to test it this week.
Official Australian retailer for Titan One, Titan Two and XIM APEX at Mod Squad
User avatar
antithesis
Colonel
Colonel
 
Posts: 1912
Joined: Sat May 28, 2016 10:45 pm

Re: Pass Mouse Button Through Xim To Titan 2

Postby trimps030 » Wed Aug 29, 2018 10:03 pm

Interesting, it sounds like running the keyboard and mouse through my computer would be the best bet. What kind of interaction with my computer would that have? Will it be moving / clicking things on my screens as I am playing? Can I run a separate mouse to my computer and still be able to use it normally?

I believe the Xim 4 is capped at 125hz? I should probably update to the Apex... 3k-4k DPI is the recommended amount? I run 12k with this mouse, my previous mouse I had been running 16,400k DPI. I thought higher was better?

Thanks for helping!
User avatar
trimps030
Corporal
Corporal
 
Posts: 5
Joined: Wed Aug 29, 2018 7:08 pm

Re: Pass Mouse Button Through Xim To Titan 2

Postby antithesis » Wed Aug 29, 2018 10:17 pm

T2 takes control of your m/kb when KMG is active, there's no movement or clicking in Windows as they're tethered to Gtuner. To toggle it on, press the KMG activation button with the mouse. To toggle it back off, press Ctrl + Esc. I have tested this and it works a treat - just toggle between PC and T2 on demand, no second mouse required.

If you're using Xim4, then use 125Hz in Gtuner settings.

Mouse DPI is largely subjective, but on an Apex running at 1000Hz, it's possible to get jitter due to the ultra-high polling detecting every minor surface imperfection or hand shake. To combat that for those affected (it's a small percentage of users), dialling polling down to 500Hz or DPI down to 3-4K cleans up the jitter.

1000Hz Apex polling can also impact XB1 performance - the XB1 chat functionality doesn't like it in some games. 500Hz again tidies that up.

None of that applies to you given you're on Xim4 because of the 125Hz polling. However, we've found that 12-16K DPI exhibits less aim assist, whereas 3-4K tends to feel stickier. Again, that comes down to personal choice.
Official Australian retailer for Titan One, Titan Two and XIM APEX at Mod Squad
User avatar
antithesis
Colonel
Colonel
 
Posts: 1912
Joined: Sat May 28, 2016 10:45 pm

Re: Pass Mouse Button Through Xim To Titan 2

Postby trimps030 » Wed Aug 29, 2018 11:47 pm

Turned my DPI setttings down to 3.5k and set the polling to 125Hz. Will have to crank my sensitivity way up in Xim 4 since I'm so used to extremely fast moves and what not in game.

Got the Titan 2 hooked up to the pc and Xim 4 successfully and am able to move around in game. I seem to be having an issue getting hotkeys to register and trigger specific events when I push them. Any advice / ideas on what I am doing wrong?

Thanks again for your help. Much easier running 1 keyboard / mouse. Forgot how much room I had on my desk.. Lol.

Edit ::
After running around in game for awhile it is extremely jerky at certain points and time. My screen almost freezes and then jumps to another (jerks?) place. This never happened when I was running the mouse straight through the Xim 4. I am sure that I have some settings that are wrong - any ideas? Polling is 125Hz, DPI is 3500, USB Multi Interface HID is selected - all of these set within the GTuner Software.
User avatar
trimps030
Corporal
Corporal
 
Posts: 5
Joined: Wed Aug 29, 2018 7:08 pm

Re: Pass Mouse Button Through Xim To Titan 2

Postby Scachi » Thu Aug 30, 2018 4:11 am

If you use Xim->T2 you can bind the same key to dpad_left+dpad_right at the same time and use some code to check for this state to trigger special action in your script.
I haven't tried it myself as I own no XIM, but I read in this forum about that this should be working.


Code: Select all
main {
  if (get_val(BUTTON_12) && get_val(BUTTON_13)) {
    set_val(BUTTON_12,0);set_val(BUTTON_13,0);
    // your code here if it should be erepeated as long as the key ist held down
  }
  if (event_active(BUTTON_12) && event_active(BUTTON_13)) {
   printf("action")// you code here to run once when the key bind to both dpad left/right is pressed
  }
}


Should also be working with dpad-up+dpad-down.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Pass Mouse Button Through Xim To Titan 2

Postby trimps030 » Thu Aug 30, 2018 4:21 am

I tried doing something similar to that but ran into the problem of the buttons still triggering whatever their ingame function is. Is there a way to negate the effect of pushing the buttons on the controller so they don't register in game?

Is that what this line of code does?
Code: Select all
set_val(BUTTON_12,0);set_val(BUTTON_13,0);
User avatar
trimps030
Corporal
Corporal
 
Posts: 5
Joined: Wed Aug 29, 2018 7:08 pm

Re: Pass Mouse Button Through Xim To Titan 2

Postby Scachi » Thu Aug 30, 2018 4:25 am

trimps030 wrote:I tried doing something similar to that but ran into the problem of the buttons still triggering whatever their ingame function is. Is there a way to negate the effect of pushing the buttons on the controller so they don't register in game?

Is that what this line of code does?
Code: Select all
set_val(BUTTON_12,0);set_val(BUTTON_13,0);

Yes
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Pass Mouse Button Through Xim To Titan 2

Postby trimps030 » Sat Sep 01, 2018 1:54 am

Got it working and it works exactly as you said it would. I am still curious though as to how I could get the keys to trigger events by running the keyboard and mouse through my pc and using KMG Capture. Being able to only have 1 keyboard / mouse on my desk would be an amazing thing. Any advice on conquering that challenge?

Thank you both again for all the help!

Edit::
I forgot about the lag issue with KMG Capture as well. Any advice on that would also be greatly appreciated!
User avatar
trimps030
Corporal
Corporal
 
Posts: 5
Joined: Wed Aug 29, 2018 7:08 pm


Return to XIM Apex, XIM4, XIM Edge with Titan devices

Who is online

Users browsing this forum: No registered users and 59 guests