Author Topic: Accessibility Script help request: Can it be done?  (Read 1615 times)

OneSwitch

  • Newbie
  • *
  • Posts: 12
Accessibility Script help request: Can it be done?
« on: September 18, 2020, 01:51:04 AM »
The accessible gaming charity, SpecialEffect, developed a brilliant speech control system for disabled people. You can see it here: https://gameaccess.info/a-specialeffect-voice-control-script/. However, it requires a big Titan Two script to work. Can the following powers be made to work in Voice Attack without T2 scripts?


1. Functions

Phrase: "Rapid Fire". Action: Initiate Rapid Fire (Next Button Said Will Rapid Fire)

Phrase: "Hold". Action: Initiate Hold (Next Button Said Will Be Held)

Phrase: "Let Go". Action: "Stop All Holds and Rapid Fires (that are currently active)



2. Combo

Phrase: "Build Combo". Action: Initiate Build Combo (Following Buttons Said Will Press When
Combo is Executed)

Phrase: "Run Combo": Action: Execute Combo


It would be great to get this working on PC alone for accessibility. But, up front, I'd love to get this power integrated into my Game Control Mixer system, which uses a Titan Two that has no script space left. It can accept PC key-presses from other apps such as VoiceAttack. I've attached my current VoiceAttack profile, and a PNG of the key-presses.

Any help, hugely appreciated.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Accessibility Script help request: Can it be done?
« Reply #1 on: September 18, 2020, 12:13:11 PM »
That should be possible.

You'll need a check in each of your button commands to see whether one of these special modes has been requested (as there is no method for intercepting a command from another command).

"Let Go" could be as simple as using the "Make VoiceAttack Stop Processing All Commands" action, which will release any keyboard keys that are held down (regardless of whether they're being held down by VoiceAttack or not); It'll also stop any running commands, but your profile doesn't appear to have any where that would be an issue.

I will note the "Stop Sounds" action in your "STOP IT" command is both non-functional and redundant, as the "Make VoiceAttack Stop Processing All Commands" action will stop the command before that action is reached, as well as stop playing sounds and TTS (as mentioned in the documentation).


For the combo system, you could have the button commands append a text variable with the keyboard key they're intended to press, so the "Run Combo" command can process the contents of that variable.

If the intent is to press all keys in the combo simultaneously, hold them down for a set amount of time, then release them again, the "Run Combo" command could be as simple as using a single variable keypress action, which will do exactly that.

The "Build Combo" command would want to clear the text variable containing the combo.


E.G.
Rapid Fire
Code: [Select]
Set text [>function] to 'rapid fire'

Hold
Code: [Select]
Set text [>function] to 'hold'

STOP IT;Let Go
Code: [Select]
Stop VoiceAttack command processing

Build Combo
Code: [Select]
Set text [combo] to ''
Set text [>function] to 'combo'

Run Combo
Code: [Select]
Press variable key(s) [combo] and hold for 0,1 seconds and release

[Alpha ; Ay]
Code: [Select]
Begin Text Compare : [>function] Equals 'rapid fire'
    Start Indefinite Loop
        Press A key and hold for 0,1 seconds and release
        Pause 0,03 seconds
    End Loop
Else If Text Compare : [>function] Equals 'hold'
    Press down A key
Else If Text Compare : [>function] Equals 'combo'
    Set text [combo] to '{TXT:combo}a'
Else
    Press A key and hold for 0,1 seconds and release
    Stop all playing sounds
End Condition


If you don't want the "Let Go" command to release all keys (E.G. those for the joysticks), you can use individual release actions for the keys you do want to release (for the vast majority of applications, releasing a key while it's not pressed does not cause any issues), as well as stopping their associated commands, E.G.
Let Go
Code: [Select]
Kill command, '[Alpha ; Ay]'
Kill command, '[Bravo ; Bee]'
Kill command, '[Ex Ray ; Ex]'
Kill command, '[Young ; Yankee ; Why]'
Release A key
Release B key
Release X key
Release Y key

OneSwitch

  • Newbie
  • *
  • Posts: 12
Re: Accessibility Script help request: Can it be done?
« Reply #2 on: September 19, 2020, 01:57:14 AM »
Thank you again. I'll be trying this next week, if not before. Looking hopeful, with your help.