Accessibility: Touch-pad to act as MENU buttons

Script to make PS Touch-pad (left and right sides) act as menu buttons. You need to glide your finger into the middle to clear. Alternative method could be to pulse these controls then clear.
Version1.00
AuthorSpecialEffect
Publish DateThu, 21 Feb 2019 - 11:34
Last UpdateThu, 21 Feb 2019 - 11:34
Downloads29
RATE


0

0

Code: Select all
// Script for Vivek - 21.2.2019
// Swap triggers with shoulder buttons and put VIEW/Back and MENU/Start on the PS4 track-pad left and right sides.
// Move finger to middle to clear.
// Based on code supplied by Vivek. Touch-pad code tweaked by Barrie Ellis - www.specialeffect.org.uk
 
remap XB1_LB -> XB1_LT;
remap XB1_RB -> XB1_RT;
remap XB1_RT -> XB1_RB;
remap XB1_LT -> XB1_LB;
 
main {
 
 
if (get_console() != PIO_PS4 && get_controller() == PIO_PS4) { // IF PS4 CONSOLE + CONTROLLER....         
    if (get_val(PS4_TOUCHX) < -40 && get_val(28)) {            // IF LEFT-side of touch-pad touched....
        block (27,500);                                        // Block Touch-pad output
        set_val(XB1_VIEW, 100);                                // Output XB1_VIEW whilst finger held. 
        }
    if (get_val(PS4_TOUCHX) > 40 && get_val(29)) {             // IF RIGHT-side of touch-pad touched....         
        block (27,500);                                        // Block Touch-pad output
        set_val(XB1_MENU, 100);                                // Output XB1_MENU whilst finger held.                                       
        }   
    else set_val(PS4_TOUCHX, 0);                               // IF above statements not true (i.e. finger in centre) clear TOUCHX to 0
    }
 
 
if (get_console() != PIO_XB1 && get_controller() == PIO_PS4) { // IF XB1 CONSOLE + PS4 CONTROLLER block six-axis to P1-P4 remapping   
       set_val(XB1_P1, 0); set_val(XB1_P2, 0); set_val(XB1_P3, 0); set_val(XB1_P4, 0);
       }
 
}