Getting VoiceAttack to push joystick buttons, set axes and POV/hat positions for you (plugin... first round... any takers?)

3,515 views
Skip to first unread message

Gary

unread,
May 5, 2015, 5:55:10 PM5/5/15
to voice...@googlegroups.com
VoiceAttack Joystick Output Plugin

What's it for?  Well, this is a plugin approach to adding joystick OUTPUT to VoiceAttack.  Since having this kind of functionality requires its own driver and maximum dependency on third-party software, it is better that it exists outside the main application.  The hope is to have a plugin that can push buttons and set sliders, stick axes and pov/hat positions all controlled by your voice (or key press... or even another joystick button (lol)).


Disclaimer :  I am not responsible for anything you do to your pc.  If this is bothersome, it's time to bail out now ;)

How to install this stuff...

First, you will need at least VoiceAttack beta v1.5.7.69.  The release version will not work with this plugin or the profile sample (compiled as x86...  sorry!).
The beta can be downloaded here:  http://www.voiceattack.com/beta.aspx.  Make sure to back up your profiles before doing this in case you want to revert to an earlier version (VoiceAttack profiles are backward-compatible, not forward compatible).  

Next, go and download the very fine application called, 'vJoy' (this plugin will not work without the supplied driver it installs).

vJoy can be found here -   http://vjoystick.sourceforge.net.

Go to downloads and then click the big, green, 'download' button in the middle of the page.  Run the executable that comes down.  
It's safe... I've been using it for a long time.  Just select all the companion applications.  You really only need the, 'vJoy Configuration application', but the other two will be really handy when setting up your profiles.

You may or may not get a Windows Security message at this point stating that the driver has not been signed/cant verify publisher/etc.  It's ok to click, 'Install the driver software anyway'.  If you are going to use the plugin, you're going to need it.  If this bothers you, it's time to bail out.  For the rest of you, this software has been around for a long time and I trust it enough to just plow on through.  The vJoy author is working on getting the driver all signed and shiny.  You should get a success message at this point plus a little Windows sound effect indicating a device was addded.

So, why did we do this?  Well, we need *something* to show up in the device list to control.  vJoy installs a virtual, 'joystick' that we can talk to through the plugin.  Your game should see the vJoy device as an actual joystick.


Next, we want to go ahead and put in the plugin so that VoiceAttack can use it.

Go here -  http://voiceattack.com/FileSend.aspx?id=VAJoystickOutput.zip (also attached here) and download the plugin zip.  It's a zipped folder with three files in it: VAJoystickOutput.dll, vJoyInterface.dll and vJoyInterfaceWrap.dll.  VAJoystickOutput.dll is the plugin and the other two files are provided by vJoy that talk to the driver (the plugin depends on these two).

Go into your VoiceAttack installation directory (usually C:\Program Files (x86)\VoiceAttack and then go into the Apps directory (or wherever you have indicated where your VoiceAttack Apps folder is located).  Copy the folder in the zip file into the Apps directory.  You should now have a foler here (usually) : C:\Program Files (x86)\VoiceAttack\Apps\VAJoystickOutput with the three files in it. 

You will need to go into the Options screen and make sure the, 'Enable Plugin Support' check box is checked (you'll have to restart VoiceAttack if you just now turned that on).  When VoiceAttack loads, you should see, 'Plugin 'VoiceAttack Joystick Output Plugin' initialized.' if everything is working as expected.


What we want to do now is go ahead and configure a stick.  You can have up to 16 virtual sticks with vJoy for all of your 16 virtual hands, but we're going to just start with one.  Go into your Windows start menu and find the vJoy folder.  Run the, 'Configure vJoy' application.  On the screen, you'll see that virtual joystick 1 is already added for you (from here out, we'll keep referring to this as, 'stick 1').  You'll notice stick 1 has all the axes selected (I just leave them all selected).  The number of buttons is probably set to 8.  You can have up to 128 buttons per stick.  For this setup, I'm just leaving at 8 for no particular reason.  You can choose up to four POV/hat controls. This is set to zero by default, so I set mine to 1.  You can choose either 4 directions or continuous.  I selected, 'continuous'.  Click the, 'Apply' button and you'll hear the device drop/add sounds.  Stick 1 is now recognized by Windows as you've configured it.  Close this app.


Go back to the start menu and open up the, 'Monitor vJoy' app.  This app can be used to test the plugin.  You'll see that it has stick 1 selected, with 1 POV/hat, all the axes and 8 buttons enabled (just like we set up).  Just let it run for now, we'll be using it shortly.

To take away some of the pain of creating a profile with commands, I created a sample one for you to import if you would like to.  Otherwise, you can skip on down to the instructions on how to use the plugin.  You can download the sample profile here -  http://voiceattack.com/FileSend.aspx?id=JoystickOutput.vap (also attached here).

Download and import the profile like you normally would.  If you edit the profile, you will see a command to test each control on stick 1.  There is one main command called, 'test stick' that will execute all the commands one after the next.  You can either speak, 'test stick' or press ALT + T.  If you are watching the Monitor vJoy app, you'll see each control turn red as each button/axis/pov is modified.  This is an indication that you've set everything up right and are ready to start using the plugin (see below for information on how to use the plugin).  ***This command just goes into an endless loop, so if you want to stop the test, just speak, 'stop test' or press ALT + S.

If this all works out for you, make sure to send a letter of thanks to the vJoy developer (Shaul Eizkovich).  I tried to get him to put up a donation page, but he just won't have it.  Nice guy, worthy of praise :)

Something to note is that if you have concurrent commands running and beating the snot out of the plugin against vJoy (acquiring without releasing), you might make it break and have to restart VoiceAttack.  You have to beat it up a lot, but it can happen.  Also, this is a first-pass effort... any feedback would be great!




How to use the plugin.

If you are not familiar with VoiceAttack plugin execution, make sure you check out the VoiceAttackHelp.pdf document that is in your VoiceAttack installation directory (and available from the start menu).

To execute a plugin function, you must first add an, 'Execute External Plugin Function' action to your command.  On the setup screen for this action, you'll want to make sure that you choose, 'VoiceAttack Joystick Output Plugin' as the plugin.  If it is not available, then you have not installed it properly (see above).

You will need to specify a context, since you can do several things with this plugin.  You can press and release a button, change an axis and change a POV/hat position.


To press or release a virtual joystick button, you will use the, 'button' context.  What you will by typing in the context box will look like this:  button;1;5;down

button;{stick number};{button number};down or up

For button press/release, you always start with the word, 'button' followed by a semicolon.  Next you'll type in the stick number.  In this case it's one... followed by another semicolon.  The next value is the button number.  We've indicated button 5, and then one last semicolon.  The last part is either, 'down' or 'up' (no quotes).  'down' presses the button, 'up' releases.

Note... as I usually point out with other things, make sure your button down and up have some sort of pause between them, so that the game will have a chance to poll for button state.


For initialization and cleanup, there is a context called, 'allbuttons'.  What you type will look like this:  allbuttons;1;up

allbuttons;{stick number};down or up

As you can probably tell, its used to set all available buttons on a certain stick to either down or up.  Works mostly like the, 'button' context, except there are only three values.  For this example, we're releasing all the available buttons on stick 1.



The next context is the, 'axis' context.  This will let you set a value to any one of the various axes available.  What you will be typing in will look like this: axis;X;1;15000

axis;{axis name};{stick number};{position value}

To set an axis, you always start with the word 'axis'.  The next value is the axis you want to change.  It can be 'X', 'Y', 'Z', 'RX', 'RY', 'RZ', 'SL0' or 'SL1' (without quotes).  In this instance, we are using axis, 'X'.  The next value is, of course, the stick number.  The last value is the position you want to set.  This is a value between 0 and 32767.  In this example, we are using 15000.

Like, 'allbuttons', for initialization/cleanup there is an, 'allaxis' context which will allow you to set all available axes to a value (probably zero in most cases). What you will be typing will look like this:  allaxis;1;0

allaxis;{stick number};{position value}

Pretty straight-forward.  In our example, we are setting all the axes on stick 1 to zero.


To change the POV/hat positions, you will use the 'pov' context.  What you will be typing will look something like this: pov;1;3;17000

pov;{stick number};{pov number};{position value}

To set a pov/hat position, you always start with the word, 'pov'.  The next value is the stick number.  The third value is the pov/hat controller you want to set.  This value will be between 1 and 4 (since you can have only up to four of these per stick).  In our example, we're changing the third pov/hat on the first stick.  The last value is the position value.  This value will need to be between 0 and 35900. 0 is always straight forward with values going clockwise around in a circle.  Right would be around 9000, down would be about 18000, left would be about 27000 (you get the idea).  To set pov/hat in the CENTER (neutral) position, set this value to -1 :  pov;1;3;-1.

Once again, for initialization/cleanup there is the, 'allpov' context.  What you type will look like this: allpov;1;-1

allpov;{stick number};{position value}

Again, pretty straight forward.  In our example, we are setting all available pov/hats on stick 1 to the neutral/center position (-1).


LastVAJOInvokeError text value variable
You'll notice in the sample profile, there's a lot of usage of the following block:
Begin Text Compare : [LastVAJOInvokeError] Does Not Equal ''
    Write '[Orange] {TXT:LastVAJOInvokeError}' to log
End Condition

Each time you execute the plugin, you have the oportunity to examine the LastVAJOInvokeError text value to see if everything went ok.  An empty value in this variable means nothing bad happened.  Anything else is an indication that something went wrong.  In the block above, we're just looking to see if it is not empty.  If it's not empty, we just dump the error to the log.  This is a pretty rigid approach.  Later, there will be extra context values that will allow you to specify what text value to stuff the error message into for a particular action (better for concurrent commands).   If needed, of course...  this could be everything anybody would need already.

Note: If you want to capture the last error, make sure you check the box titled, 'Wait for the plugin function to finish before continuing'...  otherwise, your macro will be long gone before the plugin returns ;)

Hope this all makes sense.  Have fun!

Gary
VAJoystickOutput.zip
JoystickOutput.vap

Ragnar

unread,
May 12, 2015, 4:23:45 AM5/12/15
to voice...@googlegroups.com
Awesome stuff!

While I'm not yet sure I'll be using this soon (but who knows), I had a quick test just now anyway. Once I updated vJoy it worked great!

(Little bit unsure about the POV hat, it seems to be stuck at the top position? Then momentarily it goes to center (test hat 1 neutral), or momentarily to the bottom position (test hat 1 down))


Anyway, I just wanted to say that I've also been using vJoy for some time now (since last summer I think), and I find it rock solid. I've added and deleted vJoys with seemingly no ill effects, also uninstalled and installed it back and forth a while ago (plus updated it just now). Using Windows 7 Ultimate 64-bit btw (except I had a 64-bit Vista something last summer, no issues there either as far as I remember).

Btw I'm using it with UJR - Universal Joystick Remapper, basically to combine the clutch and accelerator pedals on my G27 wheel for yaw (rudder) control (since the default and only optional combining of the (middle) brake and accelerator axis felt rather silly).

Gary

unread,
May 13, 2015, 5:51:15 AM5/13/15
to voice...@googlegroups.com, raro...@gmail.com
Cool.  Thanks for giving this a whirl.  The vJoy component initializes the POV/hat at position 0 by default, which is forward.  Not sure why it's set up that way, but I can go ahead and set it to center position (-1), which would save the pain of having to do that yourself over and over and over.

Are you playing E:D or Star Citizen?  If so, how many sticks can you select in those games?  I guess I really should get out there and try these o_O

Again, thanks for the feedback ;)

Gary

Ragnar

unread,
May 15, 2015, 3:46:13 PM5/15/15
to voice...@googlegroups.com, raro...@gmail.com
No problem. Thank YOU for an amazing software and the tireless improvements!

I sometimes mess around with E:D, but I can't seem to really get into the game (barely past the starter ship :P). I find it cool and all, even using Oculus Rift DK2 for the added immersion (but with a few graphical glitches and a somewhat marginal GPU lol, so there's that).

As for the number of sticks in E:D, I don't know the limits. I got a couple of nice sticks (a HOTAS with joystick and a separate throttle controller), and the G27 wheel as mentioned, plus the vJoy used for G27 pedals as rudder control, so at least these 4 (or is that 3?) works well.

(Sorry for the late reply)

- Ragnar

max foos

unread,
Jul 8, 2015, 9:56:33 AM7/8/15
to voice...@googlegroups.com
Does it still work?

I have some Problems with the installation -.-

PLEASE ANSWER ;)

Nekora

unread,
Jul 8, 2015, 11:48:14 AM7/8/15
to voice...@googlegroups.com
Max foos, ive insatlled and set this to work with Elite dangerous so it seems to be working for me, what problem are you haveing with the instalation?
Message has been deleted

Clayton M

unread,
Aug 15, 2015, 3:58:36 AM8/15/15
to VoiceAttack
Gary,

I am playing Elite Dangerous using the CH Products Fighterstick and ProThrottle (which means a lot of buttons and hats).  Will this be able to tell if I am using a particular hat on the throttle as opposed to a particular hat on the stick?

Gary

unread,
Aug 15, 2015, 8:32:52 PM8/15/15
to VoiceAttack
Hi, Clayton.  This does not utilize your existing (physical) sticks in any way.  What it does is control a virtual joystick that you set up to your liking.

Hope that helps!

Gary

Iain Lennon

unread,
Aug 27, 2015, 1:07:58 AM8/27/15
to VoiceAttack
Morning,

Hoped to try this out with current beta version (.73) 
Followed instructions, and installed the test profile

I see "plugin support enabled" come up in the log, 
if I "test axis x" I see 
06:06:14 - UNABLE TO INVOKE PLUGIN. PLUGIN NOT VALID FOR THIS VERSION OF VOICEATTACK.

Does this have to work only with certain beta versions?

Gary

unread,
Aug 28, 2015, 1:45:06 AM8/28/15
to VoiceAttack
Hi, Iain.

That version should be working & others have been using it.  I'll need to take a look at it.

Gary

Thomas Quirder

unread,
Oct 19, 2015, 12:38:44 PM10/19/15
to VoiceAttack
Hey Gary.....

as I mentioned in the past, I would like to see that VA can capture the Buttons of my Thrustmaster Warthog.
Va doesn't recognize any of the Buttons and or POV'S......

Unfortunatly that makes it neccessary to use Autohotkey as a workaround....


Regards

Thomas Quirder

unread,
Oct 22, 2015, 6:24:44 AM10/22/15
to VoiceAttack
Ok, I have done some investigations and found out that the Warthog is recognized.

But VA doesnt like the switches when they are switched to on onto the Warthog Throttle.

This ist unfortunatly very often an issue due to many functions within DCS.......

Also it isn't possible to say VA to wait until I have released this Joybutton or not react on some buttons, espacially when they are not defined as combination.

But never the less VOICEATTACK is a very great piece of software....

Regards
Message has been deleted

Ian Wells

unread,
Dec 27, 2015, 6:25:18 AM12/27/15
to VoiceAttack
Hi Gary,

I have been trying out the new Joystick output feature.
Unfortunately I've come a cropper when trying out the "Test Stick" command in your sample profile.
It pops up an error message "Version of Driver (216) doe NOT match DLL version (205)"
I'm guessing that the VA Joystick Output plugin is checking for a particular version of the vjoy driver, which appears to have been updated since the plugin was uploaded.

Do you think I should downgrade my version of vjoy, or wait for a plugin update?

Cheers,
Ian

Ian Wells

unread,
Dec 27, 2015, 7:02:32 AM12/27/15
to VoiceAttack
Hi Gary,

In answer to my own question, I'll await the next round of joystick output support - I tried downgrading vjoy, but it seems that the latest beta of VA itself doesn't support the plugin.
I'm in no desperate rush to use this, so happy to wait.

Regards,
Ian

Martin Nielsen

unread,
Mar 29, 2016, 1:04:48 AM3/29/16
to VoiceAttack
Any news in regarding to this subject of joystick output?

It is really the only thing missing and the only thing it needs is an update to the latest version of vjoy which has not been silent for quite some time, but works _very_ well even with windows 10 as it is, so wondering if anything it could just be simply upgraded to appropriate version as it is currently looking for 205 rather then 216 as mentioned two above this and that's a while now since, so its pretty solid in terms of vjoy if it got updated.
Reply all
Reply to author
Forward
0 new messages