The keyboard, along with the mouse, is one of the foundational ways to interact with your computer. Today, we’ll learn how to control the keyboard automatically using Elephant Automation
In this video you’ll learn:
- How to create a keyboard macro
- How to type keyboard automatically
- How to send key combinations to an application
- How to type special keys
- How to repeat a key or key combination
- How to navigate application menus using keyboard
[TRANSCRIPTION]
The Keyboard Input tool is used to simulate a human typing on the keyboard. You can use it to enter text into the program, navigate menus, tab through a program, or enter key combinations like Ctrl-C and Ctrl-V.
The first thing you do is to set the input mode. You’ll quickly find that the last 3 options are practically identical. They are designed to make it simple to do a quick key combination without having to remember any of the intricacies of the Send Keystrokes to Application option. All you have to do is click on the modifier keys you want to use and then choose a
letter, number or key to use with it.
However, the real power comes in using the Send Keystrokes to Application option. Let’s start by entering text into a field. We’ll open notepad and click on the area where we want to enter text. Then in the keyboard Input tool, we’ll enter some text that we want typed into notepad.
We’ll run it and as expected it simply types the text into notepad.
Now, lets use a mapping to add text from an output into what we type. We’ll use a simple input to get a persons name, then we’ll add the mapping in the Keyboard Input step. Here’s what it looks like when it runs.
If you look at your computers keyboard, you’ll notice that not all the keys are 1 letter long. For special keys, we use a set of curly braces around a key code. For example, the ENTER key would be represented as curly brace ENTER curly brace. The F2 key would be curly brace F2 curly brace. For a list of all the key codes, check out the link below this video.
In order to understand the Keyboard Input step fully, we need to discuss key combinations. Key combinations are simply multiple keys pressed at the same time. The most famous key combination is probably CTRL-ALT-DELETE. There are two ways to do key combinations within
the Send Keystrokes to Application mode. The first is to use a modifier and the second is to use parentheses to surround the entire key combination.
There are 4 keys that Elephant Automation recognizes as modifiers. The CTRL key, the ALT key, the
SHIFT key, and the Windows key. They are represented by the carat key, the exclamation key, the plus key and the pound or number key. How modifiers work is that the key following the modifier is added to the key combination the modifier started.
Here are some examples of common key combinations.
In the properties page, there is a Send letters lowercase when inside a key combination option. This is sometimes necessary, because when you use a capital letter, what is actually typed is shift and the key. Some programs don’t care if you add the shift in there and some do, so it really depends on the program your automating. Most of the time you should just leave it set to default and only uncheck it for specific needs.
Another way to do key combinations is to use parentheses to surround the keys. This has the advantage of being able to use any of the keys even if they aren’t modifiers. One thing to note is that you can interchange modifiers and parentheses.
All of these examples are valid key combinations.
At some point in time, you’ll probably have the need to repeatedly press the same character many times in a row. This is how we do it. We put the key in curly braces like a special key, add a space and then the number of times we want it to repeat. For key combinations, we use the parentheses method and after the last key we add a space and then the number of times we want it to repeat.
…
There are two cool features of this tool I haven’t mentioned yet. These are non typing actions that you can trigger while in the middle of automatic typing.
The first is SLEEP. You use the sleep command to put a pause or delay between key strokes. This is nice if you have to wait for a small period of time for something to happen before continuing. The second feature is called CLIPBOARD. In the property page, there is this the Use clipboard to paste text when applicable option. This is useful in that instead of having to simulate each keystroke, all you have to do is simulate Ctrl-C and Ctrl-V, so this offers a dramatic time savings,
…
Let’s explore using these commands while we learn to navigate some menus in a program. We’ll add another keyboard input step to navigate the menu bar. The first thing to do is to use the ALT key to activate the menu bar. You navigate by using the underlined letters. One common example to try is ALT-F-S which is usually used for saving your current file. Another one is ALT-F-X which we’ll use for exiting the program. This will pop up a prompt for us asking if we want to save or not. We use the sleep command to put a little pause in there to let it load in case the system is slow. When we navigate menus, we need to send the actual keys themselves rather than a command to paste from the clipboard.