Latest Titan Two update + XIM4

Titan Two general support. Questions, firmware update, feature request.

Re: Latest Titan Two update + XIM4

Postby pablosscripts » Thu Feb 01, 2018 12:57 am

Wow. You never cease to amaze me. I'll try this out when I get home!
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR

My R6 script: https://youtu.be/x-9NtxyySVM
User avatar
pablosscripts
Brigadier General
Brigadier General
 
Posts: 1976
Joined: Tue Nov 24, 2015 6:27 am

Re: Latest Titan Two update + XIM4

Postby pablosscripts » Thu Feb 01, 2018 4:07 am

Sillyasskid wrote:
pablosscripts wrote:I have buttons on my joystick that trigger key parts of my script, unfortunately that wouldn't work.
Try unchecking the Disable Joystick from Multi Interface HID output,

And then run this script when you have the T2 connected to the Xim4.
Code: Select all
main {
  mouse_passthru();
  key_passthru();
  set_val(STICK_1_X, 98.818954);
  set_val(STICK_1_Y, 98.822006);
}
This should allow you to use the mouse just fine. Along with the joystick controls.
Well all controls besides the Right Sticks X and Y.


If you still need access to the right stick on the controller as well, maybe this script will work for that.
Code: Select all
main {
  mouse_passthru();
  key_passthru();
  set_val(STICK_1_X, get_actual(STICK_1_X) + 98.818954);
  set_val(STICK_1_Y, get_actual(STICK_1_Y) + 98.822006);
}

I know the first script works. Not to sure about the second, as I have not personally tested that one.


Is this still needed (from the OP)?

Code: Select all
init {
    // Umap the keyboard and mouse from joystick output
    keymapping();
    mousemapping();
 
    // Change the output protocol to USB Multi Interface HID
    port_connect(PORT_USB_C, PROTOCOL_HID);
}
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR

My R6 script: https://youtu.be/x-9NtxyySVM
User avatar
pablosscripts
Brigadier General
Brigadier General
 
Posts: 1976
Joined: Tue Nov 24, 2015 6:27 am

Re: Latest Titan Two update + XIM4

Postby Sillyasskid » Thu Feb 01, 2018 9:25 am

pablosscripts wrote:Is this still needed (from the OP)?
Code: Select all
init {
    // Umap the keyboard and mouse from joystick output
    keymapping();
    mousemapping();
 
    // Change the output protocol to USB Multi Interface HID
    port_connect(PORT_USB_C, PROTOCOL_HID);
}

No this will reset the Xim4 when its called, So just make sure to have the output protocol already set to USB Multi Interface HID before you run the script.

Also in regards to joystick support.
I did not realize at the time, but the Xim4 sees the Triggers from the Titan Twos joysticks, as a different Axis. So this made things a lot more complex than I thought.

I did manage to come up with a workaround script.
Code: Select all
#include <mouse.gph>
#include <keyboard.gph>
const uint8 mmap[] = {
        MOUSE_X,            STICK_1_X,
        MOUSE_Y,            STICK_1_Y,
        MWHEEL_FORWARD,     BUTTON_14,
        MWHEEL_BACKWARD,    BUTTON_14,
      MBUTTON_4,            BUTTON_4,
//    Back                  Left Bumper 
      MBUTTON_5,            BUTTON_7,
//    Forward               Right Bumper 
      };
init{
mousemapping(mmap);
  printf("Make sure to swap sticks in the xim4 manager");
  printf("The swap sticks setting is under joystick in the xim4 manager");
}
main {
  mouse_passthru();
  key_passthru();
// Make Sure Output Protocol is set to USB Multi Interface HID
 
  set_val(STICK_1_X, 98.818954);
  set_val(STICK_1_Y, 98.822006);
//Disables STICK_1_X & STICK_1_Y for Joystick, this allows the Mouse to work. 
 
  set_val(STICK_2_X, get_actual(STICK_1_X));
  set_val(STICK_2_Y, get_actual(STICK_1_Y));
//Swap Sticks in the Xim 4 manager to give back the Joystick STICK_1_X and STICK_1_Y
 
if (get_actual(STICK_2_Y) < -50f) key_set(KEY_W,1); else key_set(KEY_W,0);
if (get_actual(STICK_2_X) < -50f) key_set(KEY_A,1); else key_set(KEY_A,0);
if (get_actual(STICK_2_Y) > 50f) key_set(KEY_S,1)else key_set(KEY_S,0);
if (get_actual(STICK_2_X) > 50f) key_set(KEY_D,1)else key_set(KEY_D,0);
//This allows limited Joystick support for STICK_2_Y. The left Stick.
 
set_val(BUTTON_5,0);
set_val(BUTTON_8,0);
//These buttons have to remain disabled as XIM4 sees them as an Axis rather than Buttons
 
if (mouse_status(MBUTTON_1) || get_actual(BUTTON_5)) mouse_set(MBUTTON_1,1);
if (mouse_status(MBUTTON_2) || get_actual(BUTTON_8)) mouse_set(MBUTTON_2,1);
//Allows the Mouse buttons, as well as the triggers to work.
}
 
With this script the Left Analog stick becomes a 8 button dpad, the right analog stick remains fully analog.


However, I know there are people who play with a Nav and a Mouse, and would rather have the Left analog stick remain fully analog.
This script will allow the left stick to remain fully analog. But the right stick for the joystick will no longer work. The mouse will still work fine though.
Code: Select all
#include <mouse.gph>
#include <keyboard.gph>
const uint8 mmap[] = {
        MOUSE_X,            STICK_1_X,
        MOUSE_Y,            STICK_1_Y,
        MWHEEL_FORWARD,     BUTTON_14,
        MWHEEL_BACKWARD,    BUTTON_14,
      MBUTTON_4,            BUTTON_4,
//    Back                  Left Bumper 
      MBUTTON_5,            BUTTON_7,
//    Forward               Right Bumper 
      };
init{
mousemapping(mmap);
}
main {
  mouse_passthru();
  key_passthru();
// Make Sure Output Protocol is set to USB Multi Interface HID
 
  set_val(STICK_1_X, 98.818954);
  set_val(STICK_1_Y, 98.822006);
//Disables STICK_1_X & STICK_1_Y for Joystick, this allows the Mouse to work.
 
set_val(BUTTON_5,0);
set_val(BUTTON_8,0);
//These buttons have to remain disabled as XIM4 sees them as an Axis rather than Buttons
 
if (mouse_status(MBUTTON_1) || get_actual(BUTTON_5)) mouse_set(MBUTTON_1,1);
if (mouse_status(MBUTTON_2 || get_actual(BUTTON_8)) mouse_set(MBUTTON_2,1);
//Allows the Mouse buttons, aswell as the triggers to work.
}
Last edited by Sillyasskid on Tue Feb 20, 2018 6:18 am, edited 1 time in total.
User avatar
Sillyasskid
Captain
Captain
 
Posts: 574
Joined: Sat May 14, 2016 3:07 am

Re: Latest Titan Two update + XIM4

Postby monty34 » Mon Feb 19, 2018 3:35 pm

Hi, my Xim does not show any key input if the T2 is plugged into the XIM.

I use the following script, all buttons are working in the device monitor, but not inside the XIM:
Multi HID device output is already set in Gtuner.

T2 is shown as keypad in the XIM 4. Mouse and XB conroller are plugged into T2.

Code: Select all
 
#include <mouse.gph>
 
 
const uint8 mmap[] = {
        MOUSE_X,            STICK_1_X,
        MOUSE_Y,            STICK_1_Y,
    MBUTTON_1,          BUTTON_8,
    MBUTTON_2,          BUTTON_5,
    MWHEEL_FORWARD,     BUTTON_7,
    MWHEEL_BACKWARD,    BUTTON_4,
 
      };
 
init {
    mousemapping(mmap);
}
 
main {
    mouse_passthru();
    key_passthru();
 
    // Output the key code of pressed keys
    output_keycode();
}
 
void output_keycode() {
    static uint8 previous_keycode;
    uint8 keycode;
 
    keycode = key_get();
    if(keycode != previous_keycode) {
        if(keycode) {
            printf("Key Code: %02X", keycode);
        }
        previous_keycode = keycode;
    }
    return;
}
 
 
User avatar
monty34
Command Sergeant Major
Command Sergeant Major
 
Posts: 165
Joined: Wed Jun 28, 2017 7:25 pm

Re: Latest Titan Two update + XIM4

Postby MAL8010 » Thu Mar 08, 2018 5:56 pm

Sillyasskid wrote:
pablosscripts wrote:Is this still needed (from the OP)?
Code: Select all
init {
    // Umap the keyboard and mouse from joystick output
    keymapping();
    mousemapping();
 
    // Change the output protocol to USB Multi Interface HID
    port_connect(PORT_USB_C, PROTOCOL_HID);
}

No this will reset the Xim4 when its called, So just make sure to have the output protocol already set to USB Multi Interface HID before you run the script.

Also in regards to joystick support.
I did not realize at the time, but the Xim4 sees the Triggers from the Titan Twos joysticks, as a different Axis. So this made things a lot more complex than I thought.

I did manage to come up with a workaround script.
Code: Select all
#include <mouse.gph>
#include <keyboard.gph>
const uint8 mmap[] = {
        MOUSE_X,            STICK_1_X,
        MOUSE_Y,            STICK_1_Y,
        MWHEEL_FORWARD,     BUTTON_14,
        MWHEEL_BACKWARD,    BUTTON_14,
      MBUTTON_4,            BUTTON_4,
//    Back                  Left Bumper 
      MBUTTON_5,            BUTTON_7,
//    Forward               Right Bumper 
      };
init{
mousemapping(mmap);
  printf("Make sure to swap sticks in the xim4 manager");
  printf("The swap sticks setting is under joystick in the xim4 manager");
}
main {
  mouse_passthru();
  key_passthru();
// Make Sure Output Protocol is set to USB Multi Interface HID
 
  set_val(STICK_1_X, 98.818954);
  set_val(STICK_1_Y, 98.822006);
//Disables STICK_1_X & STICK_1_Y for Joystick, this allows the Mouse to work. 
 
  set_val(STICK_2_X, get_actual(STICK_1_X));
  set_val(STICK_2_Y, get_actual(STICK_1_Y));
//Swap Sticks in the Xim 4 manager to give back the Joystick STICK_1_X and STICK_1_Y
 
if (get_actual(STICK_2_Y) < -50f) key_set(KEY_W,1); else key_set(KEY_W,0);
if (get_actual(STICK_2_X) < -50f) key_set(KEY_A,1); else key_set(KEY_A,0);
if (get_actual(STICK_2_Y) > 50f) key_set(KEY_S,1)else key_set(KEY_S,0);
if (get_actual(STICK_2_X) > 50f) key_set(KEY_D,1)else key_set(KEY_D,0);
//This allows limited Joystick support for STICK_2_Y. The left Stick.
 
set_val(BUTTON_5,0);
set_val(BUTTON_8,0);
//These buttons have to remain disabled as XIM4 sees them as an Axis rather than Buttons
 
if (mouse_status(MBUTTON_1) || get_actual(BUTTON_5)) mouse_set(MBUTTON_1,1);
if (mouse_status(MBUTTON_2) || get_actual(BUTTON_8)) mouse_set(MBUTTON_2,1);
//Allows the Mouse buttons, as well as the triggers to work.
}
 
With this script the Left Analog stick becomes a 8 button dpad, the right analog stick remains fully analog.


However, I know there are people who play with a Nav and a Mouse, and would rather have the Left analog stick remain fully analog.
This script will allow the left stick to remain fully analog. But the right stick for the joystick will no longer work. The mouse will still work fine though.
Code: Select all
#include <mouse.gph>
#include <keyboard.gph>
const uint8 mmap[] = {
        MOUSE_X,            STICK_1_X,
        MOUSE_Y,            STICK_1_Y,
        MWHEEL_FORWARD,     BUTTON_14,
        MWHEEL_BACKWARD,    BUTTON_14,
      MBUTTON_4,            BUTTON_4,
//    Back                  Left Bumper 
      MBUTTON_5,            BUTTON_7,
//    Forward               Right Bumper 
      };
init{
mousemapping(mmap);
}
main {
  mouse_passthru();
  key_passthru();
// Make Sure Output Protocol is set to USB Multi Interface HID
 
  set_val(STICK_1_X, 98.818954);
  set_val(STICK_1_Y, 98.822006);
//Disables STICK_1_X & STICK_1_Y for Joystick, this allows the Mouse to work.
 
set_val(BUTTON_5,0);
set_val(BUTTON_8,0);
//These buttons have to remain disabled as XIM4 sees them as an Axis rather than Buttons
 
if (mouse_status(MBUTTON_1) || get_actual(BUTTON_5)) mouse_set(MBUTTON_1,1);
if (mouse_status(MBUTTON_2 || get_actual(BUTTON_8)) mouse_set(MBUTTON_2,1);
//Allows the Mouse buttons, aswell as the triggers to work.
}



Been using this with a NAV and Mouse with passthrough to the XIM4 (i.e. T2 plugged into XIM4) successfully, but unfortunately it won't work with the XIM APEX - when playing fornite I just look up at the sky and spin round in circles constantly - anyone have any ideas how to correct this?
User avatar
MAL8010
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 263
Joined: Sun Feb 05, 2017 3:12 pm

Re: Latest Titan Two update + XIM4

Postby Sillyasskid » Fri Mar 09, 2018 1:37 am

I have not received my Apex yet. I should have it this week. So I cant be of much help until then. Sorry.

Other news, I figured out how to have both sticks working along with the mouse.
Both sticks will remain fullly analog using this script.

Unfortunately The triggers will have to remain digital. There is no work around to this.

Code: Select all
#pragma METAINFO("Xim4 Mouse/key/Joystick Passthu", 1, 0, "Sillyasskid")
#define MODE == // Don't Edit or Delete This Line.
#define TRUE !FALSE // Don't Edit or Delete This Line.
#define \
        \
          SET_KEYS FALSE // Change to TRUE if you need to bind your keys in the Xim Manager.

        \
        \
init {
mousemapping();
}
main {
mouse_passthru();
key_passthru();
joystick_passthru();
}
 
void joystick_passthru(bool val){
 
  if(get_actual(22) >= 0.0) set_val(4, 50.2); else set_val(4, 48.2);
  if(get_actual(21) <= 0.0) set_val(7, 48.2); else set_val(7, 50.2);
 
  if(get_actual(24) < -99.0) key_set(26, 1); if(get_actual(24) > 99.0) key_set(22, 1);
  if(get_actual(23) < -99.0) key_set(04, 1); if(get_actual(23) > 99.0) key_set(07, 1);
 
  set_val(21, get_actual(22)), set_val(22, get_actual(21));
 
  mouse_set(4, ((get_actual(4) > 1f) == 1 ? 1 : mouse_status(4)));
  key_set(104, get_actual(7) > 1f && 1 || 0);
 
#define DEADZONE_SET(IO_BUTTON, neg, pos) if(get_actual(IO_BUTTON) > (fix32) pos && get_actual(IO_BUTTON) < (fix32) neg) set_val(IO_BUTTON, 0) 
  DEADZONE_SET(22, -10, 10);
  DEADZONE_SET(21, -10, 10);
 
  if(val != NULL) set_val(4, 0), set_val(7, 0);
 
  return;
}
 
#if SET_KEYS MODE TRUE // Don't Edit or Delete This Line.
init{printf("Set Keys in Xim Manager Mode");} main {joystick_passthru(1);}  // Don't Edit or Delete This Line.
#else // Don't Edit or Delete This Line.
init{printf("Start");} // Don't Edit or Delete This Line. 
#endif // Don't Edit or Delete This Line.
Last edited by Sillyasskid on Tue Mar 13, 2018 4:45 am, edited 1 time in total.
User avatar
Sillyasskid
Captain
Captain
 
Posts: 574
Joined: Sat May 14, 2016 3:07 am

Re: Latest Titan Two update + XIM4

Postby J2Kbr » Fri Mar 09, 2018 7:15 am

MAL8010 wrote:Been using this with a NAV and Mouse with passthrough to the XIM4 (i.e. T2 plugged into XIM4) successfully, but unfortunately it won't work with the XIM APEX - when playing fornite I just look up at the sky and spin round in circles constantly - anyone have any ideas how to correct this?

It seems the Joystick interface is still being recognized by Apex even with the option to disable it is checked. I have already changed the firmware with a better approach to disable this interface. The new firmware should be out soon.
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Latest Titan Two update + XIM4

Postby Shthappensbro » Sat Mar 10, 2018 7:18 pm

J2Kbr wrote:I have not tested yet, but it should work.

The latest firmware update opens a new way to use XIM4 with the Titan Two. Normally you plug XIM4 to the Titan Two, but if the output protocol is set to "USB Multi Interface HID", you can have the mouse/keyboard connected on the Titan Two AND the Titan Two to XIM4, allowing script rapidfire and any other mod direct on the keyboard and mouse inputs. :joia: :joia:

if any one test this, please let us know the results.



So wait how do I hook it up I'm going like this xim4 to Xbox controller k & m to xim4 plug in titan two to wall and to Xbox one x then xim4 into titan two where the output. Is at is this right or a better way of doing this ?
User avatar
Shthappensbro
Major
Major
 
Posts: 754
Joined: Wed Aug 16, 2017 4:55 pm

Re: Latest Titan Two update + XIM4

Postby glitchbish » Sat Mar 10, 2018 9:09 pm

JamesCaywood wrote:So wait how do I hook it up I'm going like this xim4 to Xbox controller k & m to xim4 plug in titan two to wall and to Xbox one x then xim4 into titan two where the output. Is at is this right or a better way of doing this ?


No, instead of plugging your XIM4 into the T2 and your mouse/keyboard acts as a controller, you plug your mouse/keyboard into your T2 and then plug your T2 into the XIM4.

That way you can script mouse/keys directly instead of having them become buttons and sticks first.

Traditional way, can only do controller button scripting:

M+K => XIM4 => T2 => PS4

New way, can only do mouse/keyboard scripting:

M+K => T2 => XIM4 => PS4
User avatar
glitchbish
First Sergeant
First Sergeant
 
Posts: 45
Joined: Sat Feb 10, 2018 3:11 am

Re: Latest Titan Two update + XIM4

Postby J2Kbr » Sun Mar 11, 2018 9:33 pm

J2Kbr wrote:
MAL8010 wrote:Been using this with a NAV and Mouse with passthrough to the XIM4 (i.e. T2 plugged into XIM4) successfully, but unfortunately it won't work with the XIM APEX - when playing fornite I just look up at the sky and spin round in circles constantly - anyone have any ideas how to correct this?

It seems the Joystick interface is still being recognized by Apex even with the option to disable it is checked. I have already changed the firmware with a better approach to disable this interface. The new firmware should be out soon.

The updated released yesterday should have take care of this. I couldn't test though because don't have a Apex yet. Please let me know. Thanks.
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

PreviousNext

Return to Titan Two Device

Who is online

Users browsing this forum: No registered users and 84 guests