Keystroke Commands

Most commands you need to control a computer by voice are simple keystroke commands—"When I say this, send these keystrokes." These are easy to write in Vocola. For example, the following command types the word "Greetings" when you say "Hello World":

Vocola: Hello World = Greetings;

Say: Hello World  Sent: Greetings

In most cases the keystrokes you want to send will use modifier key sequences to control a particular application. For example, most Windows applications perform a "Copy" operation when you hold down the "Control" key and type the letter "c". The next command uses the phrase "Copy That" to invoke such a "Copy" operation:

Vocola: Copy That = {Ctrl+c};

Say: Copy That  Sent: {Ctrl+c}

You can use multiple modifier keys for a keystroke, and also specify a repeat count. For example:

Vocola: Select Two Words = {Ctrl+Shift+Right_2};

Say: Select Two Words  Sent: {Ctrl+Shift+Right_2}

This holds down both the "Control" and "Shift" keys and presses the right arrow key twice to select the two words following the insertion point.

The Vocola syntax for specifying modifier key sequences such as {Ctrl+c} is borrowed from the Dragon Macro Language, which describes the syntax. (See the discussion on pp. 13-14 and the table on pp. 116-117, or just absorb it from the Vocola examples.)

Each Vocola command contains a series of terms (indicating what is said) and a series of actions (indicating what is done), separated by '=' and terminated by ';'. In this section the terms are words and the actions are keystrokes; later sections introduce other possibilities.

Because Windows applications allow keyboard control of almost everything you can usually write a keystroke command to do what you want. The next example tells Windows Explorer to copy the name of the currently-selected file:

Vocola: Copy Filename = {F2}{Shift+End}{Ctrl+c}{Esc};

Say: Copy Filename  Sent: {F2}{Shift+End}{Ctrl+c}{Esc}

Here's how it works:

{F2}Enter "rename" mode, which opens a small edit field on the file name
{Shift+End}Select the entire file name
{Ctrl+c}Copy the selection
{Esc}Cancel "rename" mode

You may find it helpful to browse Microsoft's pages of Keyboard Shortcuts.

 
Copyright © 2002-2023 Rick Mohr