Accessibility: Quick Press Filter / Pulse + Rumble + LED Blink output

Designed to filter out unwanted fast taps on the LS button. When a long enough press is detected, a short pulsed down-up of the A button is triggered along with a short rumble and blink of an LED. For more on accessible gaming, see SpecialEffect at www.SpecialEffect.org.uk.
Version1.00
AuthorSpecialEffect
Publish DateSat, 4 Jul 2015 - 10:34
Last UpdateSat, 4 Jul 2015 - 10:34
Downloads80
RATE


0

0

Code: Select all
// Blink Switch Filter (LS/L3 linked to BLINK - INVERTED open to select - no blink filter)
//
//
// www.SpecialEffect.org.uk
// Original thread working on this script at: http://www.consoletuner.com/forum/viewtopic.php?f=6&t=1795
// Many thanks to Jefferson Kopee and UK_Wildcats_Fans for assistance in building this script.
 
 
 
define BLINK    = XB360_LS;
define LED      = 500// Length of time for LED to be on.
 
int filter      = 500// Deliberate Blink time
int pulse_time  = 500// Time that "A" is pulsed.
int wait_time   = 4000; // Time to wait before checking for a blink again.
 
int run_combo_once = FALSE;
 
main {
    if(get_val(XB360_XBOX) && get_ptime(XB360_XBOX) >= 100) {
        load_slot(4); // change the number to the slot number you want load. // PRESS XBOX TO CHANGE MODE
        }
 
 
    if(event_press(BLINK)) { // If any input is detected, flash LED 1.
        run_combo_once = TRUE;
        set_ledx(LED_1, 1);set_rumble(RUMBLE_A, 0);
        combo_stop(Blink_Accepted);
    }
    if(run_combo_once && get_val(BLINK) && get_ptime(BLINK) > filter) { // Check for a deliberate blink
        combo_run(Blink_Accepted);
    }
    // Suppressing A.
    set_val(BLINK, 0);
}
combo Blink_Accepted // Routine for pulsing the "A" button, flashing LED 2, rumbling motor gently and pausing before checking for input again.
{
    set_val(XB360_A, 100);
    set_ledx(LED_2, 6);
    set_rumble(RUMBLE_A, 20);
    wait(LED);
    wait(pulse_time);
    set_val(XB360_A, 0);
    set_rumble(RUMBLE_A, 0);
    wait(wait_time);
    run_combo_once = FALSE;
}