Author Topic: FSX seems clueless  (Read 984 times)

tres2

  • Newbie
  • *
  • Posts: 3
FSX seems clueless
« on: November 14, 2017, 02:37:41 pm »
Hi,

I'm   Tres Pierson. I just started the trial registration this morning and I'm very impressed!

I have gotten involved in this with only one very narrowly focused specific need; I need to command mouse scroll wheel activity inside FSX as my finger dexterity is insufficient to the task due to chronic progressive multiple sclerosis.

I have gotten to the point where I have figured out how to create a couple of commands; one called "scroll up 10" another called "scroll down 10" and a third called "click". Each of these works just fine across multiple platforms including one of my war games, EXCEPT in FSX which does nothing. So I'm doing something wrong.

I know it will work with FSX because I found out about it from an FSX user recommended it.

So, any ideas on where I should start looking? Thanks very much in advance!

Tres

tres2

  • Newbie
  • *
  • Posts: 3
Re: FSX seems clueless
« Reply #1 on: November 16, 2017, 07:27:40 am »
D'oh! For anybody else who, like me, is a dummy, the answer is run as administrator!

For heaven sake, I should know better than that.

Now I'm at the place where my scroll up 10 or scroll down 10 command works but it will only scroll one click at a time I can't get it to do more - any ideas greatly appreciated.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 1731
Re: FSX seems clueless
« Reply #2 on: November 16, 2017, 07:52:55 am »
Hi, Tres.

Glad to hear you got this mostly sorted.  Was in the middle of replying to you yesterday, but I got pulled off on to something and did not return.

You'll want to try putting a little bit of a pause between clicks and see if that works.

Click forward
Pause 0.01
Click forward
Pause 0.01
Click forward

It could be that VA is doing the clicks faster than FSX is polling.  If that works, adjust the pauses until it feels right (and FSX still responds).

Hope that helps!


tres2

  • Newbie
  • *
  • Posts: 3
Re: FSX seems clueless
« Reply #3 on: November 19, 2017, 10:47:06 am »
Hi Gary,

Thanks for that!

I actually blundered into it yesterday myself and now I have six macros;scroll up five, 10, and 20 and scroll down five, 10, and 20. Because of that I can now control an airplane I got some months ago and was previously unable to work with. I can see I have a lot to learn here, but I'm licking my chops to get started learning it. Thanks for getting back and I'm sure I'll be torturing you with more questions in the future LOL!
« Last Edit: November 19, 2017, 10:52:18 am by tres2 »

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1570
  • RTFM
Re: FSX seems clueless
« Reply #4 on: November 19, 2017, 01:35:22 pm »
It didn't occur to me that running as admin could be the issue, so I wasn't much help there, but perhaps this is of use to you:

scroll [up;down] [1..4,5]
Code: [Select]
Begin Text Compare : [{CMD}] Contains 'up'
    Start Loop : Repeat [{TXTNUM:"{CMD}"}] Times
        Scroll mouse wheel forward 1 click
        Pause 0.01 seconds
    End Loop
Else
    Start Loop : Repeat [{TXTNUM:"{CMD}"}] Times
        Scroll mouse wheel backward 1 click
        Pause 0.01 seconds
    End Loop
End Condition

It uses some of VoiceAttack's more advanced features like dynamic command sections, conditions, (nested)tokens, and for loops:

"[up;down]" means either "up" or "down" can be spoken as part of the command phrase, and the command will be recognized.

"[1..4,5]" in the command name will be extrapolated by VoiceAttack into 5, 10, 15, and 20, meaning any of those numbers can be spoken as part of the command phrase and be recognized.
If you want finer control or a wider range you can change or remove the multiplier(E.G. "[1..20]" will allow you to speak any number between 1 and 20), or manually specify the numbers(E.G. "[5;10;20]). You can also combine both options(E.G. "[1..4;1..4,5]" to allow 1, 2, 3, 4, 5, 10, 15, and 20).

See the "Dynamic command sections" section on page 17 of VoiceAttackHelp.pdf for more information on both of the above and other applications of dynamic command sections.


The "{CMD}" token will be substituted with the command phrase that was recognized(E.G. "scroll down 10"), whereas the "{TXTNUM:}" token will be replaced with any numbers filtered from the input, which in this case is '"{CMD}"'(E.G. "scroll down 10" would return "10"); Note the double quotes around the "{CMD}" token used as input, which are used to indicate literal input rather than a variable name.

See the "Text (and Text-To-Speech) Tokens" section on page 115 of VoiceAttackHelp.pdf for more information on tokens and their utility.


The condition will check whether the spoken command phrase contains "up", and either execute the first block of actions(from "Begin" to "Else") and ignore the second if it does, or ignore the first block and execute the second(from "Else" to "End" if it doesn't.

See the "'Begin a Conditional (If Statement) Block'" and subsequent sections starting on page 53 for more information on conditions and their various branching options. Also have a look at the "Using the Condition Builder" section on page 106 of VoiceAttackHelp.pdf for even more advanced options.


The For loop will repeat anything between its "Start Loop" and "End Loop" actions a given number of times.
As it is given the nested "{TXTNUM:"{CMD}"}" tokens as input, this number is filtered from the spoken command.

Loops are covered as a continuation of the conditions section, starting with the "'Add a Loop Start'" section on page 60 of VoiceAttackHelp.pdf


Delays are set to Gary's proposed 10ms, but can of course be tweaked or removed depending on your own findings.


I've attached a .vap containing the command which you can import into your own profile, if you're interested.