Anasoft Autowork User's Guide

5.4.1 Editing Macro Instructions in the VME  Contents  5.4.3 Editing Mouse Instructions


5.4.2 Editing Keyboard and Text Instructions


back to 5.4 Editing the Instructions of a Macro

 

5.4.2.1 Key Stroke, Key Down and Key Up
     Basics

     Key Stroke

     Key Combination

     Upper and Lower Characters

     Key Editor

     Describing an "Unnamed Key" by a Key ID

5.4.2.2 Text Input
 

There are two kinds of instructions under this category - 1) Key Actions (key stroke, key down or key up), 2) Text Input. Key Actions are useful if you are interested in action on a single key, and it's also the result of macro recording. If you need to input a large block of text at a time, you are advised to use Text Input.

 

5.4.2.1 Key Stroke, Key Down and Key Up

 

 

Pic UG-5.4-2-1 Key Action

 

Basics

There are two kinds of status for a key in the keyboard:

 

1) Pressed/released: or down and up, this is easy to understand.

2) Toggle On/Off: Besides, each key has a toggle status. The toggle status changes between on and off after each key stroke. You will see the toggle status for Caps Lock, Num Lock and Scroll Lock changes each time you stroke the key. This is shown by a light on the keyboard. Each other key in your keyboard also has a toggle status, on or off. There is no light for any other key to show their toggle status, but the toggle status really exists.

 

The basic key operations are Key Down and Key Up. When Autowork records a macro containing keyboard actions, the actions are saved as Key Downs and Key Ups. A Key Stroke is just a continuous Key Down + Key Up pair for the same key. Most other complicated keyboard actions as far as we should care are just combination of Key Downs and Key Ups. A key down/up operation has a parameter of "repeat count". In most time, the repeat count is just 1.

 

Key Stroke

Key Stroke is just a connected Down+Up pair for the same key. Autowork supports the combined Key Stroke action to simulate typing of a character.

 

Key Combination

Key combination (such as Ctrl+Shift+F) can be simulated by key operation for the three keys - Shift, Ctrl and F - sequentially. So pressing Ctrl+Shift+F can mean pressing Ctrl -> pressing Shift -> pressing F. Key Stroke combination for (Ctrl+Shift+F) means:

 

     Step 1) pressing Ctrl

     Step 2) pressing Shift

     Step 3) pressing F

     Step 4) releasing F

     Step 5) releasing Shift

     Step 6) releasing Ctrl

 

Usually the sequence between the two helping keys - Ctrl and Shift (or Alt if you use it) - is not important. So you can perform the first 2 steps in any order, and last 2 operations also in any order for the same effects. Sure there is time some application requires the proper sequence, but most application do not.

 

If you are editing a "Key Stroke" operation in the VIE (Visual Instruction Editor), you can combine your key with Ctrl or Shift or Alt. The operation will be combined together to perform. Since Key Down and Key Up are basic actions, you cannot directly select any of the 3 status keys together with your key down or key up. If you hope to simulate the result of Key Down or Key Up of some key combined with any one / two / three of these status keys, you can press these status key(s) one after another first, and press your function key later. The result will be key combination.

 

Upper and Lower Characters

Though some key has both an upper value (such as "A", "$") and a lower value (such as "a" and "4"), each key in the keyboard is just represented by one Key ID in Autowork. There are two ways for you to input a specific upper or lower value for a key. One is to use Text Input instruction as described below. You can input any character in upper of lower case, or even a whole block of text, at the time Text Input executed, the text block will be input to specified insertion point exactly in a whole. Another method is to use Key combinations as described above. Please make sure the Caps Lock or Num Lock (if you will use key in the Numeral Pad area) value is correct before you use it:

 

For example:

Caps Lock Status

Final Value You Want

("a" and "A" here are values)

Key / Key Combination to Realize the Effect

(A and Shift here are keys)

Off

"a"

A

Off

"A"

Shift+A

On

"a"

Shift+A

On

"A"

A

 

Key Editor

Key Editor appears when you click the button at the right end of the key value editing controls in VIE. In this dialog box, you can decide a key by its name or Key ID.

 

 

Pic UG-5.4-2-2 Key Editor

 

Windows recognize at most 255 keys with hexadecimal value 0x01-0xFF (or 1-255 in decimal, in fact the ID 0xFF is also never used). Since most keyboards have about 100 keys, more than half of the 255 key IDs are not used. If your keyboard is a standard keyboard, you can find all keys in your key board in the Key Name combo box. However, some keyboard may use some special keys which cannot be found in the Key Name combo box. If this happened, you can choose corresponding Key ID in the ID combo box.

 

The Key ID option is prepared for advanced users. If you do not have enough knowledge on keyboard keys, you are advised only to choose a key from the Key Name combo box.

 

Describing an "Unnamed Key" by a Key ID

As described above, if you want to describe an unnamed key, you can present it by the corresponding Key ID in the form of 0xXX (0x01-0xFF). This is an advanced option. If you are not an expert who knows clearly the meaning of a Key ID, you are NOT advised to use this ID, though generally there would be no big danger, there may be unexpected result under specific situation.

 

5.4.2.2 Text Input

 

 

Pic UG-5.4-2-3 Edit Text Input

 

You can edit and insert a block of text in a time by this instruction at current insertion point. If your cursor is not at the insertion position you expect it should be, you should place some instruction, such as a mouse click, preceding this Text Input instruction to move your cursor and specify a suitable insertion point before your text can be input into the right place.