Accessibility: Upside Down Controller

An upside down controller. Sensitivity can be adjusted from the script, and MENU and back/start buttons can be restricted too.
Version1.00
AuthorSpecialEffect
Publish DateTue, 25 Oct 2016 - 16:54
Last UpdateTue, 25 Oct 2016 - 16:54
Downloads16
RATE


0

0

Code: Select all
// ROTATE UPSIDE DOWN
// B.ELLIS 10-2016
 
// JOYSTICK SENSITIVITY ADJUSTMENT (FOR A VERY SENSITIVE THUMB-STICK, TRY SENSITIVITY = 327, MIDPOINT = 25, JOY_DEADZONE = 35)
define SENSITIVITY = 100; // SENSITIVITY (327 MAX - COMMON MAX FOR XBOX = 150).
define MID_POINT = 50; // INPUT MIDPOINT IS (set low for weaker input, 50 for default - 70 COMMON MAX FOR XBOX).
 
define JOY_DEADZONE = 20; // 20 (SMALLEST) -99 (LARGEST) TO ADJUST DEADZONE
define TWEAK = 20; // will add to JOY-DEADZONE - normally useful for one-stick steering
define JOY_BUTTONS_DEADZONE = 80; // JOYSTICK ACTING AS BUTTONS - NEEDS A BIGGER DEADZONE TO AVOID ACCIDENTAL PRESSES
define Z_DEADZONE = 5; // TRIGGERS
define LSTICK_MAX = 100; // ANALOGUE CONTROLS MAXIMUM OUPUT (0-100%)
define RSTICK_MAX = 100;
define TRIGGERS_MAX = 100;
 
define RESTRICTED = 0;          // 1 = OFF   1 = BLOCK MENU BUTTON
define EXTRA_RESTRICTIONS = 0// 1 = OFF   1 = BLOCK BACK/SELECT/SHARE/START/OPTIONS
 
 
main {
 
// SET SENSITIVITY
deadzone(PS3_LX, PS3_LY, DZ_CIRCLE, 0); sensitivity (PS3_LX, MID_POINT, SENSITIVITY);sensitivity (PS3_LY, MID_POINT, SENSITIVITY);
deadzone(PS3_RX, PS3_RY, DZ_CIRCLE, 0); sensitivity (PS3_RX, MID_POINT, SENSITIVITY);sensitivity (PS3_RY, MID_POINT, SENSITIVITY);
 
        swap(PS3_TRIANGLE, PS3_DOWN); swap(PS3_CROSS, PS3_UP); // REMAPPING
        swap(PS3_SQUARE, PS3_RIGHT); swap(PS3_CIRCLE, PS3_LEFT); // REMAPPING
 
//        swap(PS3_TRIANGLE, PS3_CROSS); swap(PS3_CIRCLE, PS3_SQUARE); // ALTERNTIVE CURSOR / SHAPES/ABXY REMAPPING
//        swap(PS3_UP, PS3_DOWN); swap(PS3_LEFT, PS3_RIGHT); //
 
        swap(PS3_LX, PS3_RX); swap(PS3_LY, PS3_RY); // REMAPPING
        swap(PS3_L1, PS3_R1); swap(PS3_L2, PS3_R2); // REMAPPING
        swap(PS3_L3, PS3_R3);
        swap(PS3_START, PS3_SELECT);
 
        if(get_val(PS3_LX) > JOY_DEADZONE) {set_val(PS3_LX, get_val(PS3_LX)*-1);} else {set_val(PS3_LX, get_val(PS3_LX)*-1);} // LX INVERTED
        if(get_val(PS3_RX) > JOY_DEADZONE) {set_val(PS3_RX, get_val(PS3_RX)*-1);} else {set_val(PS3_RX, get_val(PS3_RX)*-1);} // RX INVERTED
 
        if(get_val(PS3_LY) > JOY_DEADZONE) {set_val(PS3_LY, get_val(PS3_LY)*-1);} else {set_val(PS3_LY, get_val(PS3_LY)*-1);} // LY INVERTED
        if(get_val(PS3_RY) > JOY_DEADZONE) {set_val(PS3_RY, get_val(PS3_RY)*-1);} else {set_val(PS3_RY, get_val(PS3_RY)*-1);} // RY INVERTED
 
        if(get_val(PS3_LX) <= JOY_DEADZONE && get_val(PS3_LX) >= JOY_DEADZONE*-1) set_val(PS3_LX,0); // DEAD-ZONE FILTER
        if(get_val(PS3_LY) <= JOY_DEADZONE && get_val(PS3_LY) >= JOY_DEADZONE*-1) set_val(PS3_LY,0);
        if(get_val(PS3_L2) <= Z_DEADZONE && get_val(PS3_L2) >= Z_DEADZONE*-1) set_val(PS3_L2,0);
 
        if(get_val(PS3_RX) <= JOY_DEADZONE && get_val(PS3_RX) >= JOY_DEADZONE*-1) set_val(PS3_RX,0); // DEAD-ZONE FILTER R-STICK
        if(get_val(PS3_RY) <= JOY_DEADZONE && get_val(PS3_RY) >= JOY_DEADZONE*-1) set_val(PS3_RY,0);
        if(get_val(PS3_R2) <= Z_DEADZONE && get_val(PS3_R2) >= Z_DEADZONE*-1) set_val(PS3_R2,0);
 
        if(get_val(PS3_LX) >= LSTICK_MAX) {set_val(PS3_LX, LSTICK_MAX);} // MAXIMUM STRENGTH LIMITER
        if(get_val(PS3_LX) <= -LSTICK_MAX) {set_val(PS3_LX, -LSTICK_MAX);}
        if(get_val(PS3_LY) >= LSTICK_MAX) {set_val(PS3_LY, LSTICK_MAX);}
        if(get_val(PS3_LY) <= -LSTICK_MAX) {set_val(PS3_LY, -LSTICK_MAX);}
 
 
        if(get_val(PS3_SELECT) > 0 && EXTRA_RESTRICTIONS) { set_val(PS3_SELECT, 0); }
        if(get_val(PS3_START) > 0 && EXTRA_RESTRICTIONS) { set_val(PS3_START, 0); }
 
        }