FULL CHANGELOG

2.54 Fixed resolution scaling issues for TomcatTwo's SH3 mod (forgot to do the dials)

2.53 Fixed resolution scaling issues for TomcatTwo's SH3 mod

2.52 Added voice commands (and necessary code support) for "Pause Recognition" and "Resume Recognition". Reports of left-handed mode from version 2.51 not working have not yet been addressed. I'm not sure what else I can do - when you use left-handed mode, it clicks the right mouse button, not the left, so it should work!

2.51 Added additional launch BAT files for left-handed users. If you change your mouse orientation in Windows to left-handed, sh4speech basically ignores it, so it's pressing the wrong button. Use the left-handed batch files and it'll work. It will just press the right mouse button for all clicks instead of the left in this case.

2.50 WARNING: Compatibility issues with customized CSV files!

Copies of press_to_talk.csv and voice_commands.csv have been placed in the respective stock and trigger maru folders, and the ones in "csv files" has been removed. The idea is that each CSV set should have it's own versions of these to allow greater customization. TM had a few overrides in a separate voice_commands.csv file in it's subfolder, but those have been merged into its custom voice_commands.csv, and the code that loaded those special commands has been removed, making this version incompatible with the old CSV file structure. You must match mine now. It's easy to do yourself if you have custom CSVs - make a copy of the two files into stock. Then merge the contents of the trigger maru voice_commands.csv into the main version. Then delete the voice_commands.csv in trigger maru. Move the main voice_commands.csv into the trigger maru folder, and you're done.

This makes a lot more sense and is much more flexible, even though it means you will have to maintain separate CSVs for each configuration. The idea here is to allow as many configurations as you want, selectable by simply modifying the BAT file, with complete separation between them, no sharing of voice_commands.csv or press_to_talk.csv settings.

Other changes:
The fix in 2.25 which helped when there were extra spaces in the CSVs was not working for the voice_commands.csv override file for TM, only the main file. This problem is fixed.
All of the files in DIST have been modified.
The main BAT file for trigger maru has been modified.
Tube handling code modified to support 3 tube boats (all fore tubes) and 5 tube boats (4 fore, 1 aft.)

2.25 There was a problem where if a voice command had an extra space at the end of it, it would still be recognized but then fail to properly perform the command due to a hash key mismatch. I added a line to strip off any trailing spaces from the voice commands to avoid this problem. This could easily happen due to the way Excel tends to handle copying and pasting and it's easy to end up with a lot of voice commands that have the space and it's a pain to remove them. The only file changed in this build is voice.exe and this ChangeLog.htm file.

2.24 Tweaked the key pressing code so that "hold keys" such as CTRL-G does not assume that there is only one key to be held. Therefore you can now indicate CTRL+SHIFT+ALT+G and it will assume that all of the keys except the last one (G) are to be held, then the G is pressed, then the three keys are released.

A little refresher course on how to use all this. You can't reference something like CTRL+SHIFT+ALT+G via the KEY column of key_commands.csv unless you define any such key combinations in key_codes.csv. So, in key_codes.csv, you'll notice that SHIFT is 0x10 and CTRL is 0x11 and ALT is 0x12 and G is 0x47 in key_codes.csv. So, you would enter "CTRL+SHIFT+ALT+G" in the KEY column, and "0x11+0x10+0x12+0x47" in the Virtual Key Code column. Scan codes are still not used for now and can be ignored, but you should enter 0x00.

2.23 This untested version was a colossal failure and if you somehow get your hands on it and run it, your computer will probably explode and kill your whole family.

2.22 Added a general delay multiplier that slows all key and mouse commands. Default is 1, meaning delays are multiplied by 1, no change. Set this via the launch BAT files. I strongly advise you not to lower this below 1, the defaults are already aggressive enough as it is and this will likely result in missed commands.

2.21 Added a fix that will (hopefully) support middle mouse button for the Press To Talk Key. Change the key to MIDMOUSE in press_to_talk.csv to try it out. I haven't tried this at all since I'm not at home.

2.2 Added Press To Talk Mode which is enabled by default using the SysRq/PrintScreen key. To change or disable this, read the note in csv files/press_to_talk.csv. Why this key? Because if you use CTRL or ALT or SHIFT, that will modify the actual key presses that sh4speech is sending. That would be very bad. PrintScreen has no effect in SH4 and is not configured with Trigger Maru either, and it's also easy to locate without having to look down at the keyboard.

Also added an automatic restart to the voice engine every 10 minutes. This restart takes very slightly more than a half second so it should be virtually unnoticable. This fixes the SAPISVR.EXE memory leak issue (or more accurately, hacks around it.)

2.1 Added full support for Trigger Maru custom commands.cfg (key configuration) files. There is now an additional voice_commands.csv file in the trigger maru CSV folder, which only contains the differences, or overrides, for the stock configuration. The launch BAT files have been modified as well.

So, for example, in stock configuration, it does Battle Stations by clicking a command bar entry, since the stock voice command points to id #569 (which is the command_bar.csv entry). But, in TM mode, the same voice commands are present with a different ID #57.5, which is the B key in key_commands.csv. So it overrides 569 with 57.5 since the TM stuff is loaded last.

2.06 The location to move the mouse away after clicking certain commands is now configurable, just set coordinate of id #584 in command_bar.csv to whatever you want (0,0 is upper left, 1024x768 is lower right, it will scale from there to other resolutions)

2.05 Oops, I forgot to actually add the two launch BAT files for v2.03, I only put in the other changes. This fixes that.

2.04 Fixed the fuel/battery/o2/co2 buttons when command bar is unlocked mode

2.03 There are now two launch executables, one for Trigger Maru and one for stock. They have totally different command bar configurations so this had to be done.

Note that even if you use Trigger Maru, you still need to use the stock key configuration. So you need to overwrite commands.cfg with the stock copy. I made a little mod for this in JGSME which I install after TM to ensure it gets overwritten properly.

2.02 Updated command bar to work with Trigger Maru 1.6. Also, mouse moves to a high central visible area instead of far upper left after commands.

2.01 The previous version 2.0 had a minor bug that caused the resolution change in the BAT file to not be recognized. This is fixed!

2.0 No install required, only the Microsoft Speech SDK. All resolutions supported. Added PK, Torp Settings, TDC controls

> All resolutions are supported. Edit go.pl and type your resolution at the top under $RESOLUTION = "1024x768".

> New voice commands:

> > "torpedo settings" and "PK status" (both do the same, toggles the mode. Be sure the torp settings mode is up before doing the following:)
> > "[increase or decrease] torpedo depth [1-49] feet" (relative to current setting)
> > "exploder contact"
> > "exploder influence"
> > "torpedo speed low" or "low speed torpedoes"
> > "torpedo speed high" or "high speed torpedoes"
> > "spread [right or left] [0-19] degrees" (relative to current setting! So if it's 5 right now, and you want it 5 left, say "left 10 degrees")
> > "range finder " or "range tool" (sorry, "stadimeter" just won't recognize)
> > "[increase or decrease] target angle [1-179] degrees" (auto-sends to computer)
> > "[increase or decrease] target speed [1-40] knots" (auto-sends to computer)
> > "calculate target speed" (auto-sends to computer)
> > "toggle PK " (clicks once)
> > "update PK " (clicks twice to update after new readings are sent in)
> > (you can also use the full phrase "position keeper" for "PK")

> All of these commands will automatically make sure the necessary panel is visible if you have it minimized, except torpedo settings - you need to make sure that's visible, toggle that with "torpedo settings" or "PK status".

> Range is done only with the range finder (stadimeter), you can't increase or decrease the range by a certain number of feet, the dial is too weird (for now). Sorry!

> Other Changes:

> > If the Knotmeter dial mode is active, and you say a Telegraph speed command, it will flip the dial to be in that mode, and of course flip back to Knotmeter once you use one of those commands again.

> > Mouse is moved to upper left after most commands to avoid obscuring the view with tooltips or magnified dials.

> > Command bar works properly even if it is in unlocked mode by moving the mouse to the bottom left momentarily, and "traveling" from the tab to the button.

> > Corrected voice commands with "co2" for better recognition (it needed "c o two"). Added "ahead slow" as an alias for 2/3. Removed some extra Recognition Manual command that were overlapping/confusing with the Trigger Maru "id target" command. Removed voice command for Decoys since there's a key already mapped to that.

> > Regarding compatibility, if you have customized dials.csv or command_bar.csv, please note there is a new column #3 inserted called "Quadrant". This is where it helps if you noted your customizations, since you can just add them to my files. But I'm pretty sure you should have had no reason to changes these two files. Quadrant is only required when the x/y resolution fields are filled in, otherwise it is ignored.

> > Also, a "Parent" column has been inserted after "Name" for key_commands.csv, variables.csv, and tubes.csv, as these commands now all support having parent IDs. I don't want to get into details on this yet as I don't recommend doing anything with it, as more changes may come. Just make sure you merge this correctly with your changes, preferably by pasting your customized entries into these new files and making sure the columns all line up.

1.63 Critical fix for ignored keystrokes

> My removal of Win32-GuiTest caused the key presses to all be ignored, due to forgetting to bring over a critical part of that script. Probably broken from 1.6 to 1.62. Fixed!

1.62 Minor fixes

> Increased compatibility with oscillating house fans and pet snakes (by removing the "fish" and "pause" commands which would often be recognized with any blowing or hissing into the microphone.) Turns out, it is good practice to use the longest phrases you can - very short single-word phrases are more likely to be picked up by the mic with random noise than more complex ones. Fish and Pause would pop up all the time for me.

1.61 Fixed bugs with tube commands

> The tube voice command IDs were wrong due to some organizational changes and were throwing errors. Fixed.

1.6 Control over heading, rudders, and depth dials added (Imperial only!)

> Added the very important STARTING A GAME section below to explain all the initialization voice commands that you need to do upon starting a new game, loading a save, or entering/exiting port. Read it now!

> You can now change bearings, rudders, and depth precisely. Oh yeah! Over 900 voice commands have been added to support this feature.

> The assumptions made are that your boat is A.) Capable of 25 knots max, B.) Capable of 38 degree rudder maximums, and B.) Capable of 165 feet on the shallow depth meter and 450 feet on the deep depth meter. If the boat you're using doesn't meet these specs, this isn't going to work, and a different dials.csv file will need to be set up for your boat. These are the boat specs on the training missions and I believe for the Porpoise class boats.

1. "make your depth 15 feet" through "make your depth 450 feet". 165 or less is on the shallow dial, above 165 is on the deep dial.
2. "rudder left 1 degree" or "rudder right 38 degrees". Max is 38.
3. "heading right 1 degree" through "heading right 179 degrees". Of course you can say "left" instead. You can do "heading 180 degrees", and if you accidentally say "right" or "left" on that, you're covered. You can do 360 if you want (lol). There's no reason you can't add the additional commands for right 181 through 379, I left them out since there's a hell of a lot of voice commands in there already, but they will definitely work. The heading you specify is relative to the top of the compass at the time you say it - if you're mid-turn it's going to be screwy. Using this command is basically like saying "click on the heading dial 90 degrees to the right of top dead center" and it just clicks it.

> Other Changes:

> Dependence on Win32::GuiTest has been completely eliminated, and it has been removed from the package and install.bat. I now directly use the Win32 APIs. Some people were having trouble installing Win32::GuiTest so this is a big step forward for those people. Win32::SAPI5 was never used so I removed it from the archive to reduce size.

> Due to this and some other changes, you can now run sh4speech from anywhere you want.

> The types in command_bar.csv are either "Tab" or "Button", and new types called "Dial" and "MouseClick" have been added. In the code these are all handled the same way - they are mouseclicks on coordinates that may have a parent. A parent is just another entry in the same file that must be clicked first. It will keep tracing them back until it finds an entry without a parent, so you can chain together as many mouseclicks as you want now. The only reason to have four different types for this is for backward compatibility with existing files and to help better keep all the commands organized by allowing them to be in different CSV files.

> "SetVar", "Tube", "Command Bar" and "Dials" all have their own CSV files, separated out for organizational purposes only. You can combine them all into one file if you want, just make sure when you move commands from one CSV to another that they are of the same type. The types are explained here in the FILE STRUCTURE section.

> The types of files at the bottom of the readme have been updated to explain all of these.

> Oxygen related voice commands changed to prefer the phrase "compressed air" instead of oxygen (I thought it had something to do with breathable air, that's all CO2 levels though.)

> There has also been some major code rearchitecting so if anyone is actually following along, well, you're going to have to start over. :)

1.55 Added Trigger Maru custom command bar items

> Added command bar info and voice commands for extra command bar buttons added by Trigger Maru mod. These are labeled in the CSV files using the extra column space to the right. If you're not running Trigger Maru, these shouldn't affect anything since it will most likely click empty space. But if you don't use this mod, you might want to remove these to prevent the possibility of a false recognition of one of these.

1.51 Minor fix, increased mouse click reliability

> Increased mouse delays from 0.1 to 0.2 seconds, as it would sometimes miss a click.

1.5 Command bar support added, and minor fixes

> New Features:

> > Support added for command bar using mouse clicks. If a voice command ID is not found in key_commands.csv, it falls back on command_bar.csv. If it finds a match, it uses the mouse coordinates x/y depending on your resolution.

> > After adding this feature and many voice commands for it (and other existing key items), there are now nearly 400 recognizable voice commands!

> > You MUST set the $RESOLUTION variable at the top of go.pl! Default is 1024x768. Only 1024x768 and 1920x1080 are supported right now, others will be added later.

> > A large collection (over 170!) useful voice commands have been added to take advantage of the command_bar functions. These IDs are in the 500 range. Use of the command bar is avoided for any cases where there is a default key mapping, so you will find many are defined in command_bar.csv but have no matching voice commands. There's a lot of voice commands, feel free to edit them down or add more, and if you're worried there's too many to remember, keep in mind that a lot have been added so that you don't have to remember them all. Just say it the way the captain would and there's a good chance it will be recognized. I even added "How long until we die from noxious fumes?" :)

> > You MUST be sure your mouse cursor is visible before using any of these commands! If you don't, the first click could be missed and it might click a button on a different bar and get you killed! Take special care when using the binoculars to call out a deck gun target, since you most likely will be moving the mouse real-time and won't have the mouse cursor visible. Just set the crosshairs to the fore of the target, click to show the mouse cursor and call it out. Since it won't be obvious which ones require this, it's good practice to simply ensure you can see your mouse before issuing any voice commands at all. Sorry, that kind of sucks I know, but I have no way to know the status of that. Worst case is your periscope gets spun around unexpectedly - shouldn't be a problem if you lock on. :)

> > Readme converted to HTML.

> Compatibility:

> > Since I often change the various CSV files, I would advise the following: Keep in mind that extra columns of data to the right in the CSVs are ignored. So, you should use that column to add a note anytime you add your own voice command. When I release a new version and you want to merge with my new commands, simply sort your file by your custom note column and copy/paste all of those into my file and use that. I will no longer be tracking compatibility issues with the CSV files, it's up to you to merge them correctly.

> Bug Fixes:

> > Removed call to wxPython from install.bat

1.38 Minor fixes

> Changed type of "cycle tubes" (id=15) to "Tube" in order to add some special handling (updates the current_tube internal variable to keep track of what tube you're on)
> Added a few more voice command aliases, such as "rig for silent running"
> Updated speech control panel recommendations in the readme
> Fixed screwed up double-folder zip structure introduced probably in 1.35

1.35 Minor enhancement and bugfixes

> Bugfixes:

> > "set all tubes closed" now sets the current_tube variable to 1 since loading a savegame, docking, or any other condition that causes you to use this command probably means it's not still on tube 3 or whatever your last tube was.

> Enhancements:

> > Added "reset tubes" and "reset all tubes" voice command alias for "set all tubes closed" since that makes more sense.
> > Eliminated python popup window by using command line pipe redirection instead
> > Increased recognition speed from a polling rate of 10x per second to instantaneous with above trick
> > Both programs must now terminate together which is nice, since sometimes various restarts would result in two hear.py's running
> > Removed some extraneous junk files from the package, including wxPython which is actually not needed. Drastically shrinks the ZIP size too

> Compatibility:

> > Two voice command aliases added for id #95 (just some tube reset commands)

1.3 Tube door management features added

> Enhancement:

> > Added functions to manage tube doors. First you say "setup 4 tubes" or "i have 4 tubes" to tell sh4speech how many tubes are on your sub. You only have to do this once for a session and you can change it at any time without restarting by just saying it again. It supports 4, 6, 8, or 10 tubes according to the documentation. If you plan to use this feature at all, it is important that you not click any tube with the mouse or press the cycle tube (W), open/close tube door (Q), or Fire (space/enter) ever using the keyboard. Otherwise I'll lose track of the current tube door status. Now you really have an excuse to say "Wifey, I really do have to use the voice commands to play the game!" :)

> > Now that you've told sh4speech how many tubes you have, you can use the following commands:
> > open tube 3
> > open tube 5
> > open tube 5 (this command will be ignored since it's already open)
> > fire (this will automatically close tube 5)
> > tube 1 (this just selects that tube)
> > fire (again this will automatically set the tube door status to closed, but since it already was it doesn't really matter)

> > At this point, remember tube 3 is still open and it will remember that indefinitely.

> > If you dock or otherwise think all of your tube doors are closed again, just say "reset tubes" (id=95). Note that this doesn't actually close any tube doors, it just sets the internal status so that they can be opened.

> > Note that key_command.csv has new command IDs of 61-64 which are of a new type "SetVar" which is just for internal use for now. IDs 65-95 are of a new type "tube" which are handled special by the script, so the "Key or Special Data" column isn't a regular keystroke of course.

> > It will automatically use command IDs 14 and 15 for handling the cycling and door toggle, and will also recognize ID 12 (Fire) for special handling in that case. Therefore it is important not to change those command IDs and a note has been added to the CSV to help remind you.

> Compatibility:

> > If you have customized key_commands.csv or voice_commands.csv, just add IDs 61-95 from both these files to your files, and check to be sure that the IDs for 12, 14, and 15 haven't changed (except the key itself which is fine to change if you've mapped a new key.)

1.2 Bugfix release

> Bug Fixes:

> > Fixed errors in multi-key sequences caused by lack of testing and general stupidity

1.1 Bugfix release and minor enhancements

> Bug Fixes:

> > Cleaned up extra commas from CSVs and fixed bug where it would fail without them (added a chomp() to each line read)
> > Lowered $KEY_HOLD (time to hold down keys) from 0.1 seconds to 0.05 seconds
> > Moved the launch of hear.py into the two BAT files since sometimes the Perl script may not launch it correctly.
> > Added a check in the perl script on the phrase.tmp file to prevent reading it while it's being written which caused a rare failure
> > Added a global variable $MULTI_KEY_DELAY to determine wait time between key presses for multi-key sequences and set it to 0.1 second
> > Updated bad download URLs in readme

> New Features and Improvements:

> > Added command chaining support using & symbol in key_commands.csv. See Raise All Masts at the bottom of that file for an example.
> > Drastically improved the text output from both windows to make more sense and help a little with debugging and general understanding
> > Improved the code readability for anyone who might be trying to match up my perl hashes to the CSV files
> > Switched to Creative Commons license since it's easier to understand
> > Added some additional missing keys to key_codes.csv to save you the trouble in case you want to use some custom commands

> Compatibility

> > No changes were made to the CSVs that would prevent you from using modified ones from v1.0 with this release.

> Bugs

> > Serious bugs with the multi-key sequences and some text output was bad. The whole thing was pretty much broken due to lack of testing :)

1.0 Initial version.

> Totally pwned the world by creating this in just 2 days. :)