Mouse to mouse raw input/bypass?

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

Mouse to mouse raw input/bypass?

Postby Brunissimus » Tue Oct 15, 2019 6:38 pm

Hello there!

I use a Titan Two with a XboxOne controller for both the Xbox One and MAINLY PC. Recently I started to play FPS in my PC with mouse&keyboard and missed my scripts...

I tried to create macros on the Logitech G HUB, but it SUCKS!!!

Why the GTUNER does't have a mouse to mouse or mouse to keyboard biding?? The perfect scenario would be a mouse movement raw/bypass and a buttons remapping/key biding...

Any comments?
User avatar
Brunissimus
Staff Sergeant
Staff Sergeant
 
Posts: 10
Joined: Tue Apr 11, 2017 11:34 am

Re: Mouse to mouse raw input/bypass?

Postby DontAtMe » Tue Oct 15, 2019 7:43 pm

Brunissimus wrote:Why the GTUNER does't have a mouse to mouse or mouse to keyboard biding?? The perfect scenario would be a mouse movement raw/bypass and a buttons remapping/key biding..


It already does.
This can be done using the key_passthru() and mouse_passthru() functions, just make sure to use the USB Multi-interface HID output though.
User avatar
DontAtMe
Captain
Captain
 
Posts: 502
Joined: Tue Oct 02, 2018 4:49 am

Re: Mouse to mouse raw input/bypass?

Postby J2Kbr » Wed Oct 16, 2019 9:57 am

This thread explains all you need to know for this purpose:

viewtopic.php?f=26&t=12344
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: Mouse to mouse raw input/bypass?

Postby Brunissimus » Wed Oct 16, 2019 2:17 pm

DontAtMe wrote:
Brunissimus wrote:Why the GTUNER does't have a mouse to mouse or mouse to keyboard biding?? The perfect scenario would be a mouse movement raw/bypass and a buttons remapping/key biding..


It already does.
This can be done using the key_passthru() and mouse_passthru() functions, just make sure to use the USB Multi-interface HID output though.

Thanks A LOT!!!
User avatar
Brunissimus
Staff Sergeant
Staff Sergeant
 
Posts: 10
Joined: Tue Apr 11, 2017 11:34 am

Re: Mouse to mouse raw input/bypass?

Postby Scachi » Wed Oct 16, 2019 2:47 pm

For a complete anti recoil + rapid fire script for USB HID search the online resource for "usb-hid anti recoil" (with the quotes)
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Mouse to mouse raw input/bypass?

Postby Brunissimus » Wed Oct 16, 2019 5:58 pm

J2Kbr wrote:This thread explains all you need to know for this purpose:

viewtopic.php?f=26&t=12344


Trick question: is it possible to passthru only the "movement" of the mouse? Because my goal is to remap and script the mouse buttons...
User avatar
Brunissimus
Staff Sergeant
Staff Sergeant
 
Posts: 10
Joined: Tue Apr 11, 2017 11:34 am

Re: Mouse to mouse raw input/bypass?

Postby Scachi » Wed Oct 16, 2019 6:56 pm

This might be able to do it. It will send the buttons always as "not pressed" but should forward the mouse movements correctly:
Code: Select all
#include <mouse.gph>
 
bool bMouseUpdate; // regular update via MREPORT_UPDATED reported (input event found)
bool bMouseForce;  // manual update because of rapid fire or  anti recoil or other script actions
 
int32 m[] = { 0, 0, 0, 0}; // mouse x,y,wheel,button1
#define M_X 0
#define M_Y 1
#define M_W 2
#define M_1 3
 
init {
    port_connect(PORT_USB_C, PROTOCOL_HID);
    keymapping();      // required for USB Multi Interface HID keyboard
    mousemapping();    // required for USB Multi Interface HID mouse   
}
 
main {
    key_passthru();                 // required for USB Multi Interface HID keyboard
    // no mouse pass_thru .. gets send by T2 code instead to override the mouse buttons and movement
 
    fMouseReset();
    fMouseUpdate();
    fMouseOutput();
}
 
void fMouseReset() {
    m[M_X]=0; m[M_Y]=0; m[M_W]=0;
}
 
void fMouseUpdate() {
    if(mouse_status(MREPORT_UPDATED)) {
        bMouseUpdate=TRUE;
        m[M_X]=mouse_status(MOUSE_X);
        m[M_Y]=mouse_status(MOUSE_Y);
        m[M_W]=mouse_status(MOUSE_WHEEL);
        m[M_1]=mouse_status(MBUTTON_1);
 
        // do something on mouse button status here:
        //if (mouse_status(MBUTTON_1))
        //if (mouse_status(MBUTTON_2))
        //if (mouse_status(MBUTTON_3))
        //if (mouse_status(MBUTTON_4))
        //if (mouse_status(MBUTTON_5))
    }
}
 
void fMouseButtons() {
    //mouse_set(MBUTTON_1, mouse_status(MBUTTON_1) ? TRUE : FALSE); // <- example to send mouse button status as it is
    mouse_set(MBUTTON_1, FALSE); // set all to not pressed
    mouse_set(MBUTTON_2, FALSE);
    mouse_set(MBUTTON_3, FALSE);
    mouse_set(MBUTTON_4, FALSE);
    mouse_set(MBUTTON_5, FALSE);
}
 
void fMouseOutput() {
    if (bMouseUpdate || bMouseForce) {
        mouse_set(MOUSE_X,m[M_X]);
        mouse_set(MOUSE_Y,m[M_Y]);
        mouse_set(MOUSE_WHEEL,m[M_W]);
        fMouseButtons();
    }
}
 
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Mouse to mouse raw input/bypass?

Postby Brunissimus » Wed Oct 16, 2019 7:05 pm

Scachi wrote:This might be able to do it. It will send the buttons always as "not pressed" but should forward the mouse movements correctly:
Code: Select all
#include <mouse.gph>
 
bool bMouseUpdate; // regular update via MREPORT_UPDATED reported (input event found)
bool bMouseForce;  // manual update because of rapid fire or  anti recoil or other script actions
 
int32 m[] = { 0, 0, 0, 0}; // mouse x,y,wheel,button1
#define M_X 0
#define M_Y 1
#define M_W 2
#define M_1 3
 
init {
    port_connect(PORT_USB_C, PROTOCOL_HID);
    keymapping();      // required for USB Multi Interface HID keyboard
    mousemapping();    // required for USB Multi Interface HID mouse   
}
 
main {
    key_passthru();                 // required for USB Multi Interface HID keyboard
    // no mouse pass_thru .. gets send by T2 code instead to override the mouse buttons and movement
 
    fMouseReset();
    fMouseUpdate();
    fMouseOutput();
}
 
void fMouseReset() {
    m[M_X]=0; m[M_Y]=0; m[M_W]=0;
}
 
void fMouseUpdate() {
    if(mouse_status(MREPORT_UPDATED)) {
        bMouseUpdate=TRUE;
        m[M_X]=mouse_status(MOUSE_X);
        m[M_Y]=mouse_status(MOUSE_Y);
        m[M_W]=mouse_status(MOUSE_WHEEL);
        m[M_1]=mouse_status(MBUTTON_1);
 
        // do something on mouse button status here:
        //if (mouse_status(MBUTTON_1))
        //if (mouse_status(MBUTTON_2))
        //if (mouse_status(MBUTTON_3))
        //if (mouse_status(MBUTTON_4))
        //if (mouse_status(MBUTTON_5))
    }
}
 
void fMouseButtons() {
    //mouse_set(MBUTTON_1, mouse_status(MBUTTON_1) ? TRUE : FALSE); // <- example to send mouse button status as it is
    mouse_set(MBUTTON_1, FALSE); // set all to not pressed
    mouse_set(MBUTTON_2, FALSE);
    mouse_set(MBUTTON_3, FALSE);
    mouse_set(MBUTTON_4, FALSE);
    mouse_set(MBUTTON_5, FALSE);
}
 
void fMouseOutput() {
    if (bMouseUpdate || bMouseForce) {
        mouse_set(MOUSE_X,m[M_X]);
        mouse_set(MOUSE_Y,m[M_Y]);
        mouse_set(MOUSE_WHEEL,m[M_W]);
        fMouseButtons();
    }
}
 



Thanks a LOT! I will try it tonight
User avatar
Brunissimus
Staff Sergeant
Staff Sergeant
 
Posts: 10
Joined: Tue Apr 11, 2017 11:34 am


Return to Titan Two Device

Who is online

Users browsing this forum: No registered users and 34 guests