Accessible Script Requests for Disabled Users
Posted: Fri Jun 12, 2015 4:54 pm
The Titan One has been a revolution for many people. Thanks so much to Jefferson for creating it. These are two [updated] requests I hope someone can help with...
1. Blink Switch: I'm hoping to find a way to create a filter for a man using a blink switch as his only way to interact with a computer. I thought perfecthuntr's code below would be the solution, but I think there's a bit more to this than I first realised. This is what is needed to the best of my understanding...
2. Two switch exploration filter: The code below seems to work nicely with huge thanks to UK_Wildcats_Fans. I just need a way to filter out a bounced 2nd press of the L3 button. More on this later on in this thread. This code enables exploration using just two buttons.
The Blink Switch is quite pressing. The two-switch exploration would just be very nice for a group of learning disabled users, who'd be able to explore Proteus on the Playstation 3 with this method with minimal technical support needed for supporting staff.
1. Blink Switch: I'm hoping to find a way to create a filter for a man using a blink switch as his only way to interact with a computer. I thought perfecthuntr's code below would be the solution, but I think there's a bit more to this than I first realised. This is what is needed to the best of my understanding...
- A. You can replicate the blink hardware (a Toby Churchill unit plugged into an adapted Xbox 360 joypad) by holding the "A" button down to simulate shutting your eyes, or releasing "A" to open your eyes.
B. A filter is needed so that fast presses of the A button (quick blinks) are ignored.
C. When a deliberate longer press of the A button is detected, this is passed through as a short pressed then released activation. There then needs to be a delay before checking for input again.
D. An inverted version is needed, whereby the man can select by opening his eyes (releasing "A").
- Code: Select all
int timer, stop;
main {
// Timer - Countdown function
if (timer > 0) {
timer = timer - get_rtime();
}
// Timer - Detection of the first tap
if (event_press(PS4_CROSS)) {
timer = fTapTimer(timer);
if (timer == 0) { // If a second tap was detected
stop = TRUE;
}
}
if (stop) { // If the second tap was detected, stop the PS4_CROSS button for 100 ms
combo_run(test);
}
}
combo test {
set_val(PS4_CROSS, 0);
wait(100);
stop = FALSE;
}
// Timer function for multi-taps
function fTapTimer(timer) {
if (timer <= 0) {
timer = 100; // Start the timer
}
// Timer - Detection of next tap within 100 ms
else {
timer = 0;
}
return timer;
}
2. Two switch exploration filter: The code below seems to work nicely with huge thanks to UK_Wildcats_Fans. I just need a way to filter out a bounced 2nd press of the L3 button. More on this later on in this thread. This code enables exploration using just two buttons.
- Code: Select all
// Script for Special Effect
// see the posts below as reference
// viewtopic.php?f=6&t=1210
// viewtopic.php?f=6&t=1795&p=12979#p12979
define forward_val = 70;
define side_val = 70;
define DeadZoneLeftStick = 20;
int ForwardToggleON = FALSE;
int LeftMovementToggle = FALSE; // FALSE = move right; TRUE = move left;
int timer, stop;
main {
// Dead Zone Detection
if ( get_val(PS3_LX) >= -DeadZoneLeftStick && get_val(PS3_LX) <= DeadZoneLeftStick) {set_val(PS3_LX,0);}
if ( get_val(PS3_LY) >= -DeadZoneLeftStick && get_val(PS3_LY) <= DeadZoneLeftStick) {set_val(PS3_LY,0);}
// Forward Movement
if (event_press(PS3_L3)) {ForwardToggleON = !ForwardToggleON;} // Toggles forward movement on/off
if (ForwardToggleON) {set_val(PS3_LY,-forward_val);set_val(PS4_L3, 0);} // -value is move forward; +value is move backwards ; Swallow L3 button whilst turning on movement
if (!ForwardToggleON) {set_val(PS4_L3, 0);} // ; Swallow L3 button whilst turning off movement
// Side to Side Movement
if (event_press(PS3_R3)) {LeftMovementToggle = !LeftMovementToggle;} // Toggles between left and right movements
if (get_val(PS3_R3) && LeftMovementToggle) {set_val(PS3_RX,-side_val);set_val(PS4_R3, 0);} // -value is move left ; Swallow R3 button whilst looking left.
if (get_val(PS3_R3) && !LeftMovementToggle) {set_val(PS3_RX,side_val);set_val(PS4_R3, 0);} // +value is move right ; Swallow R3 button whilst steering right.
}
The Blink Switch is quite pressing. The two-switch exploration would just be very nice for a group of learning disabled users, who'd be able to explore Proteus on the Playstation 3 with this method with minimal technical support needed for supporting staff.