Gamepad to Mouse: Help needed

GPC2 script programming for Titan Two. Code examples, questions, requests.

Re: Gamepad to Mouse: Help needed

Postby Scachi » Fri Sep 27, 2019 10:30 am

That is perfect now :smile0517: I'll be working on it the next week as time and health allows :smile0517:
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Gamepad to Mouse: Help needed

Postby SpecialEffect » Fri Sep 27, 2019 12:48 pm

No rush at all! Good health to you.

Oh one other greedy thought.... Stick sensitivity and deadzone adjustment would be great for people with limited strength.

Good luck!!
User avatar
SpecialEffect
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 203
Joined: Mon Apr 07, 2014 3:26 pm

Re: Gamepad to Mouse: Help needed

Postby SpecialEffect » Thu Oct 03, 2019 11:42 am

I have noticed a problem. Not sure if you're aware of how to fix it.

If I swap slots between Mouse mode and Joypad HID modes two or three times, I find that the Mouse Mode slot stops working. The only solution (to me) is to restart the computer. Any idea why this might be?
User avatar
SpecialEffect
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 203
Joined: Mon Apr 07, 2014 3:26 pm

Re: Gamepad to Mouse: Help needed

Postby teddy18 » Tue Jun 09, 2020 1:38 pm

Nice i will try the script
User avatar
teddy18
Lieutenant
Lieutenant
 
Posts: 346
Joined: Sun Jul 19, 2015 4:18 pm

Re: Gamepad to Mouse: Help needed

Postby ILL_MURDER » Thu Feb 04, 2021 9:56 am

is there any way to get sony nav and logitech g502 support for left stick? as well as assigning buttons to functiond?
User avatar
ILL_MURDER
Sergeant First Class
Sergeant First Class
 
Posts: 18
Joined: Thu Nov 02, 2017 6:01 pm

Re: Gamepad to Mouse: Help needed

Postby J2Kbr » Thu Feb 04, 2021 2:45 pm

ILL_MURDER wrote:is there any way to get sony nav and logitech g502 support for left stick? as well as assigning buttons to functiond?

Here is the init block of one of my script where I configure both the PS Nav and mouse G502 for Apex legends:

Nav connected to the Titan Two via Bluetooth A, and the G502 at USB Input-B.
Code: Select all
 
#define PS4             0
#define XBOX            1
#define SWITCH          2
 
#define CONSOLE         PS4
 
#include <remapper.gph>
#include <keyboard.gph>
#include <mouse.gph>
 
init {
    push_to_talk(FALSE);
    port_inhibit_ffb(PORT_USB_A);
 
    remapper_disable(STICK_1_X);
    remapper_disable(STICK_1_Y);
    remapper_disable(ACCEL_1_X);
    remapper_disable(ACCEL_1_Y);
    remapper_disable(ACCEL_1_Z);
    remapper_swap(BUTTON_6, BUTTON_9);
    remapper_mask(RMP_BT_A);
 
    const uint8 kmap[] = {
        KEY_P,              BUTTON_17,
        KEY_OPENBRACKET,    BUTTON_4,
        KEY_CLOSEBRACKET,   BUTTON_2,
        KEY_BACKSLASH,      BUTTON_3,
    }; keymapping(kmap);
 
    const uint8 mmap[] = {
        MOUSE_X,            STICK_1_X,
        MOUSE_Y,            STICK_1_Y,
        MWHEEL_FORWARD,     BUTTON_14,
        MWHEEL_BACKWARD,    BUTTON_21,
        MBUTTON_1,          BUTTON_5,
        MBUTTON_2,          BUTTON_16,
        MBUTTON_3,          BUTTON_9,
        MBUTTON_4,          BUTTON_13,
        MBUTTON_5,          BUTTON_10,
    }; mousemapping(mmap);
 
    #define hex2u(n)        n >> 8, n
    #define evaluate(n)     hex2u(n##i)
    #define fix2hex(n)      evaluate(n)
 
    #if CONSOLE == PS4
    #define DATA_SET        2
    #define GLOBAL_HSCALE   0.95
    #define GLOBAL_VSCALE   0.95
    #define SENSITIVITY     2.80
    #define YX_RATIO        1.00
    #define DD_FACTOR       0.13
    #define DZ_HORIZONTAL   13.0
    #define DZ_VERTICAL     13.0
    const uint8 mxyc[] = {
        0xFF,
        fix2hex(SENSITIVITY), fix2hex(YX_RATIO), fix2hex(DD_FACTOR),
        fix2hex(DZ_HORIZONTAL), fix2hex(DZ_VERTICAL), 0x00, 0xCA,
        0x00, 0x00, 0x12, 0x0A, 0x1A, 0xA8, 0x20, 0xF0, 0x25, 0xA3, 0x2A, 0x59,
        0x2F, 0x0F, 0x32, 0xFA, 0x36, 0x1E, 0x3A, 0x0A, 0x3D, 0x2E, 0x40, 0x4F,
        0x43, 0x73, 0x46, 0x97, 0x49, 0xB8, 0x4C, 0x14, 0x4F, 0x35, 0x51, 0x91,
        0x54, 0xB3, 0x57, 0x0F, 0x5A, 0x33
    }; mxyconverter(mxyc);
    #elif CONSOLE == XBOX
    #define DATA_SET        2
    #define GLOBAL_HSCALE   1.15
    #define GLOBAL_VSCALE   1.15
    #define SENSITIVITY     2.50
    #define YX_RATIO        1.00
    #define DD_FACTOR       0.12
    #define DZ_HORIZONTAL   12.60
    #define DZ_VERTICAL     12.60
    const uint8 mxyc[] = {
        0xFF,
        fix2hex(SENSITIVITY), fix2hex(YX_RATIO), fix2hex(DD_FACTOR),
        fix2hex(DZ_HORIZONTAL), fix2hex(DZ_VERTICAL), 0x01, 0x00,
        0x00, 0x00, 0x11, 0x40, 0x19, 0xE1, 0x20, 0x28, 0x25, 0xA3, 0x2B, 0x23,
        0x2F, 0x0F, 0x32, 0xFA, 0x36, 0xE6, 0x3A, 0x0A, 0x3D, 0xF5, 0x41, 0x19,
        0x44, 0x3A, 0x46, 0x97, 0x49, 0xB8, 0x4C, 0x14, 0x4F, 0x35, 0x51, 0x91,
        0x53, 0xEB, 0x57, 0x0F, 0x59, 0x68
    }; mxyconverter(mxyc);
    #endif
}

Hope this helps.
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: Gamepad to Mouse: Help needed

Postby rybo » Mon Feb 06, 2023 3:27 pm

Last night I posted a new topic asking if this is possible and now this morning I stumbled on this topic. I think this is exactly what I'm looking for. Is it considered ready to use and supported? If I buy a Titan One and use this script, can I make my PS3 controller show up as a generic HID keyboard and mouse on a computer that doesn't support any gamepads?
User avatar
rybo
Private First Class
Private First Class
 
Posts: 3
Joined: Mon Feb 06, 2023 4:42 am

Previous

Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 88 guests