Dual Shock 4 Universal Compatibility

Using this script allows for the following: -Use left side of touchpad as "select/back/view/minus" -Use right side of touchpad as "start/start/menu/plus" -Allows manual reset of Dual Shock 4 Authentication sequence when using a non Dual Shock 4 controller on PS4 -Remaps "select/back/view/minus" to TouchPad activator for use on PS4 and giving a hotkey combination to activate "Share" button *Note: Can be simply copy/pasted into existing scripts to enable features in any program. Put easily modifyable activation triggers in header to alleviate issues where activation trigger is in conflict with triggers already present in target script
Version2.0
AuthorX-Dream
Publish DateThu, 17 Dec 2015 - 02:25
Last UpdateMon, 21 Dec 2015 - 06:54
Downloads423
RATE


1

0

Release Notes: Set up script so there is no longer a need to activate compatibility mode. When using a Dual Shock 4 on any compatible system the Touch Pad becomes select/view/minus on the left side and start/menu/plus on the right side. When using a non DualShock4 on any system it remaps the touchpad button to select/view/minus. SHARE then is activated with a two button combination set in the header section (default -- START + UP). Set up so it can be cut and pasted into any script with no conflict.
Code: Select all
//////////////////////////////////////////////////////////////////////////
//                      DUAL SHOCK 4 COMPATIBILITY (AUTO)               //
//////////////////////////////////////////////////////////////////////////
//            Questions about script can be addressed at                //
//                        [email protected]                     //
//////////////////////////////////////////////////////////////////////////
//-----------------------DEFAULT ACTIVATION TRIGGERS--------------------//
//      RE-AUTHORIZATION == Hold                          //
//                                  and press               //
//      SHARE == Hold and press                      //
//                                                                      //
//---------------------PS4 RE-AUTHORIZATION SET UP----------------------//
//----------------------------------------------------------------------//
define REAUTH_HOLD = 2;         /*--ASSIGN THIS TO THE BUTTON TO HOLD   //
                                WHILE PRESSING TO         //
                                ACTIVATE REAUTHORIZATION                //
                                                                        */

define REAUTH_TRIG = 0;         /*--ASSIGN THIS TO THE BUTTON USED TO   //
                                TRIGGER RE-AUTHORIZATION WHILE          //
                                HOLDING                    //
                                                                        */

//----------------------------------------------------------------------//
//      CURRENTLY SET FOR HOLD "START" AND PRESS PS/XB BUTTON           //
//----------------------------------------------------------------------//
//////////////////////////////////////////////////////////////////////////
define SHARE_HOLD = 2;          /*--ASSIGN THIS TO THE BUTTON TO HOLD   //
                                WHILE PRESSING (SHARE_TRIG) TO ACTIVATE //
                                "SHARE"                                 //
                                                                        */

define SHARE_TRIG = 13;         /*--ASSIGN THIS TO THE BUTTON TO        //
                                ACTIVATE "SHARE" HOLDING    //
                                                                        */

//----------------------------------------------------------------------//
//      "SHARE" CURRENTLY SET FOR HOLD "START" THEN PRESS PRESS UP      //
//----------------------------------------------------------------------//
//////////////////////////////////////////////////////////////////////////
main {
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//            COPY THIS INTO THE MAIN BODY OF ANY                       //
//            SCRIPT TO HAVE UNIVERSAL COMPATIBILITY                    //
//----------------------------------------------------------------------//
//-------THIS IS FOR MANUAL REAUTHENTICATION WHEN USING T1 ON PS4-------//
if (get_val(REAUTH_HOLD) && event_press(REAUTH_TRIG)) {                 //
    output_reconnection();}                                             //
//----------------------------------------------------------------------//
//                                                                      //
//-------THIS SECTION IS FOR WHEN USING NON DUAL SHOCK 4 ON A PS4-------//
if (get_console() == PIO_PS4 && get_controller() != PIO_PS4) {          //
    swap (27,1);                                                        //
    if (get_val (SHARE_HOLD) && get_val(SHARE_TRIG)) {                  //
        block (SHARE_HOLD,500);                                         //
        block (SHARE_TRIG,500);                                         //
        set_val (1,100);                                                //
        }                                                               //
    }                                                                   //
//----------------------------------------------------------------------//
//                                                                      //
//-------THIS SECTION IS FOR WHEN USING DUAL SHOCK 4 ON ANY SYSTEM------//
if (get_console() != PIO_PS4 && get_controller() == PIO_PS4) {          //
    if (get_val(PS4_TOUCHX) < 0 && get_val(27)) {                       //
        block (27,500);                                                 //
        set_val(1,100);                                                 //
        }                                                               //
    if (get_val(PS4_TOUCHX) > 0 && get_val(27)) {                       //
        block (27,500);                                                 //
        set_val(2,100);                                                 //
        }                                                               //
    }                                                                   //
//----------------------------------------------------------------------//
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
}