Purpose: I am a true believer in the hotkey; keyboard shortcuts that make using a computer much more fast and efficient. As such, I like to implement them while using the AAO Editor to make my work time more efficient. AutoHotkey is a program that allows you to write and define your own keyboard shortcuts for use in any program that you use. In this quick guide, I will show you how to set up AutoHotkey, and a few tricks as to how it can be used for AAO.
Disclaimer: Sorry, the program only works in a Windows (or perhaps Windows-emulated) environment. You can stop booing now.
1. Install AutoHotkey: Simply click on this link, and then follow the setup program's instructions. It is just like installing any other program.
2. Don't be scared of scripts: There is no program to run, per se, so the next thing to do is to write a script, which tells AutoHotkey what you want your hotkeys to be. This is not as difficult as it sounds, and if you are scared, just use the ones I have provided below. I also have included some ways in which you can adjust the shortcuts yourself.
3. Load up a text editor: To begin writing your script, load up any text editor, for example Notepad. The official editor for scripts is called SciTE4, which you can download here. If you don't want something so specific, I highly recommend the excellent Notepad++. DO NOT USE WORD or OPENOFFICE! These save their files in a special format, and they WON'T work with AutoHotkey unless you save it in the correct format. But even that will be a pain, because Word has auto-correct and such. Just trust me, it is better not to use them.
4. Write a script: This is where the meat of the tutorial comes in. In AutoHotkey, there are many ways to define what you want your shortcut to do. For example, you can set it so that when you press "F2", the mouse will automatically click a part of the screen. You can set it so that "Control+7" automatically types in the word "Ace Attorney Rules!" on your computer. You can set it so that whenever you type the word "btw" that it will automatically replace it with "by the way".
Here's an example. Let's say you wanted to create a shortcut in which whenever you press the Windows key + S, it will insert a "shake" into your text. Within the editor, there are two ways to do this: you either type "[#s]" every time, or you click on the "Shake" button. However, clicking the shake button adds a space before and after, which can be a bit tedious to delete every time. Not only that, but clicking on it every time is slower than just hitting Win+S, right!?
In your text editor, write the following line:
Code: Select all
^s::Send [{#}s]
{Shortcut}::{Action}
{Shortcut} describes to the program what our shortcut will be. We want our shortcut to occur when we press the "Windows" key, AND press the "s" key while it is held down. "^s" describes EXACTLY that. The "^" character means "the windows key" to the program, and the "s" tells the program what ELSE must be pressed at the same time. Therefore:
"^s" means "Win+s"
{Action} describes what will happen when the shortcut has been pressed. In this case, we want the keyboard to type "[#s]". Using the word "Send" tells the keyboard to type whatever comes after it. However, the character "#" has a special meaning in AutoHotkey. Therefore, it has to be "escaped". In programming, an "escaped" character means that we actually want the character, not its functional meaning. In AutoHotkey, any characters with special meaning have to be surrounded by "{" and "}". Therefore, in AutoHotkey:
"Send [{#}s]" means "Type [#s]"
Before, I told you that the syntax for a shortcut is {Shortcut}::{Action}. Therefore, typing:
Code: Select all
^s::Send [{#}s]
Means, in English, "Whenever I press the Windows key and 's' at the same time, type out the word "[#s]". (Don't worry if this seems like a lot to take in, it gets easier the more you work with it!)
Following the same principle, can you think of how to make a shortcut so that when we hit "Win+F", we type in "[#f]"? Every shortcut must be on A NEW LINE.
Note: You must repeat these steps EVERY TIME you update the script. Furthermore, everytime you repeat these steps, you will get a pop-up that confirms that you want to update the script. Just click "Yes" every time.
5. More keyboard shortcuts: One of the best ways to improve the presentation of our trials is to add speech pauses. If you look at real AA games, there is always a short pause between sentences if they both appear in the same textbox. This makes sense, as when when speak in real life we tend to pause between sentences! So within the following textbox:
Code: Select all
I wasn't sure why he was
there. I'd never seen him
around the place before.
Code: Select all
I wasn't sure why he was
there.[#p25] I'd never seen him
around the place before.
Because I do that every time I end a sentence in the middle of a textbox, I've assigned a keyboard shortcut to it. I made it so that whenever I hit "Win+." (that is windows key plus the period key) it will automatically insert "[#p25]". Also, in "Justice For All" and beyond, I've noticed an even shorter pause at commas. So the following sentence:
Code: Select all
Well, I'm not so sure about
that.
Code: Select all
Well,[#p10] I'm not so sure about
that.
::{Short text}}::{Long text}
This means that any time you type whatever is in "{Short text}", it will replace it with whatever is in "{Long text}". Note that {Long text} is different than {Action}. With {Action}, you HAD to type "Send" in order to tell AutoHotkey that you wanted to type some text. In {Long Text} you do NOT type "Send", as it automatically assumes that you want to replace the text.
Let's create an example. Pretty much every AA game will talk about the Court Record on a regular basis. Whether it is explaining the basics to a new user, or referring to evidence, or adding evidence, you will need to type it on occasion. Therefore, why don't we make a shortcut for it? Whenever we type the letters "cr" and hit space, it should automatically replace it with "Court Record". Note, this will NOT take effect as soon as you type "cr"! This is good, in case you were typing the word "cream" or something. It will only take effect if the initials are isolated. To create this shortcut, we simply add the following to our script:
Code: Select all
::cr::Court Record
Just for practice, why not write some hotstrings, in which "pw" becomes "Phoenix Wright", "prc" becomes "prosecution", "yh" becomes "Your Honor", or anything else you can think of?
For example, we could make it so that whenever we type "s1.3", it changes the speed of that textbox to be 1.3 instead of 1. The way we do this is by taking advantage of TWO things: AutoHotkey's ability to hit many keys in a row, and Firefox's built-in keyboard shortcuts. (They are probably similar in other browsers, but I am only covering Firefox for now).
First, we need to figure out the EXACT combination of keys required to make this action happen. So if we are in a textbox, entering some text for a character to say, we need to find out how to get to the input box for "Speed", type "1.3" and then go back up using ONLY the keyboard. This example is actually not that difficult. When you are in a textbox, if you press Tab 3 times, you will go down to the "Speed" box. There, you can type in "1.3". After that, you press "Shift+Tab" again three times to get back up to the textbox.
With that knowledge at hand, we can make our script knowing only two additional things: to make the keyboard press tab, we must write "{Tab}" in the script. To get "Shift+Tab", we must use the special character "+", which represents "Shift". Hence, "+{Tab}" means "Shift and Tab":
Code: Select all
::s1.3::{Tab}{Tab}{Tab}1.3+{Tab}+{Tab}+{Tab}
Now try doing the same thing, setting "s1.5" to be "1.5" and "s2" to set the speed to "2"!
Again, to achieve this, we first find out the keystrokes required to achieve the result:
First, close the current textbox.
Second, add a new frame below the current one.
Third, merge the current frame with the new one we just created.
While we are in a textbox within the editor, we want to hit the confirm button. To do so, we need to hit Tab 4 times, then hit Enter.
From there, we want to create a new frame below the current one. To do so, we hit Tab 7 times, then hit Enter.
Finally, we want to go backwards and tick the checkbox that allows us to merge one frame to another. To do so, we hit Shift+Tab 7 times, then hit Space.
We look up the codes for Enter and Space in the AutoHotkey documentation. We discover that enter is just {Enter}, and space is just {Space}. And there we have it, all the information we need!
Can you think of what the script will be to make a shortcut, in which whenever we type ">>>" and hit space, we will confirm the current text area, add a frame below the current, and merge the current frame with the new one?