Contents

Overview

Screen Layouts

Buttons

Text Editing

Special Syntax

Deactivation

Examples

Acknowledgements


Overview

DEF KEY is a Keyboard Macro Program that allows the multiple keystrokes to be assigned to and executed from any Windows application. The process for this is very simplistic and straight-forward:

1. Use the Definition Key Selection on the DEF KEY main screen to select a key that will be used to activate the commands. This is called the Definition key.

2. Enter the keystrokes to mimic (letters, numbers and Special Syntax commands, which include Windows Control keys.) This is called the Definition.

3. Activate DEF KEY by clicking the ACTIVATE Button. This will cause DEF KEY to go to a Minimized Icon at the bottom of the screen.

4. Start the application that you want to send the Definition to.

5. Press the appropriate Definition key and the Definition will execute.

6. Deactivate DEF KEY by restoring the Minimized Icon to its normal screen.


Commands
Screen Layouts

Main Screen

Special Syntax Screen


Main Screen
Main Screen Layout

1. About Box. Click on this icon to view the current program revision.

2. The Text Editing box where keystrokes and the Special Syntax commands are entered (called the Definition).

3. The current Definition file in use.

4. The SAVE Button allows current definitions to be saved to disk for future use.

5. The LOAD Button retrieves existing Definition files.

6. The EXIT Button ends the DEF KEY program.

7. The ACTIVATE Button starts the actual DEF KEY session.

8. The Information Bar contains the total number of Definitions and displays other program information.

9. The Definition Key Selection Buttons allow the selection of Definition keys. The BLACK ON WHITE keys contain Definition information, whereas the WHITE ON BLACK keys do not.

10. The CLEAR Button will remove all current Definitions and start a new set of Definitions.

11. The TEST Button will test the validity of the currently selected Definition, before actually activating DEF KEY.

12. The SYNTAX Button displays a popup of Special Syntax commands that allow DEF KEY to perform Control Key maneuvers as well as simulating Windows Controls. (See the Special Syntax Screen layout.)

13. The HELP Button activates this help system.


Special Syntax Screen
Special Syntax Screen Layout

1. This is the Repeat Down Button. When clicked, the Repeat Count will decrement down to zero (0).

2. This is the Repeat Up Button. When clicked, the Repeat Count will increment up to one-hundred (100).

3. This is the Repeat Edit Box. Enter a Repeat Count from zero (0) to one-hundred (100).

4. If the OK Button is pressed, the highlighted Special Syntax command, along with the selected Repeat Count value, will be placed in the Text Editing box at the present cursor location. If NO Special Syntax command is highlighted, then control is returned to the DEF KEY main screen without modification.

5. If the Cancel Button is pressed, control is returned to the DEF KEY main screen without modification.

6. This is the Special Syntax command Selection List. Use the Scroll Bars to peruse the list and select the command that you wish to include in your Definition.


Buttons

ACTIVATE

CLEAR

EXIT

DEFINITION KEY SELECTION

LOAD

SAVE

SYNTAX

TEST


Activate Button

IMPORTANT: FOR DEF KEY TO INTERCEPT KEYSTROKES, THE INTENDED APPLICATION(S) MUST BE STARTED AFTER DEF KEY HAS BEEN ACTIVATED!

IMPORTANT: ANY APPLICATIONS THAT USE ANY ACTIVE DEFINITION KEYS FOR THEIR OWN PURPOSES WILL BE OVERRIDDEN BY DEF KEY AND NOT OPERATE. Therefore it is wise to choose a Definition Key that will not interfere with the application's normal operation.

The Activate Button starts the actual DEF KEY session. All Definitions will be active.

When pressed or clicked, DEF KEY changes to an Icon at the bottom of the screen and states that it is "Active" (as opposed to clicking the Minimize Button, which states that DEF KEY is "Inactive".) At this point, all defined keys will operate. (If there are no Definitions, the error box "No Def Keys Defined" will appear and activation will be canceled.)

If the Definition key is pressed and Definition assigned to it is in error, the error box will appear stating that there is an "Invalid Definition. Please re-check." This is usually due to the Special Syntax commands. Check these commands for uppercase and spaces. (The Definition can be verified before activation. See the TEST Button description.)

The Activation will remain in effect until DEF KEY is Deactivated.


Clear Button

The Clear Button removes all Definitions from all Definition Key Selections (This essentially returns DEF KEY to the original Start-up state.) You are prompted BEFORE this is done. If you choose the "No" Button, the action is aborted.

The Clear Button is disabled until the Text Editing box changes or until a Definition file is loaded.


Exit Button

The Exit Button terminates DEF KEY. If there are any Definitions that have changed and are not saved to a Definition file, you will be prompted to do so. If you choose not to save the current Definitions, they will be lost.


Definition Key Selection
Definition Key Selection Buttons

The Definition Key Selection allows you to set a Definition to a particular Definition key. In some applications, the Function Keys are used to perform commands adherent to that program. DEF KEY gives the user eight (8) different Function Keys to choose from. (Function Keys F1 and F10 are NOT used, because they are usually assigned to HELP and MENU, respectively.)

To select a Definition Key, click on or tab to the Definition Key Buttons. Use the Right/Left Arrow keys or click on an unmarked key to changed Definitions.

(The Definition Keys use a "Radio Button Control", which means that only one (1) key can be chosen.)

When there is text in the Text Editing box, the Definition key is said to have a Definition and will be utilized when DEF KEY is activated. The color scheme for this Definition Key is BLACK ON WHITE.

When there is no text in the Text Editing box, the Definition key is said to have no Definition and will not be utilized when DEF KEY is activated. The color scheme for this Definition Key is WHITE ON BLACK.


Load Button

The Load Button is used to restore Definitions from a Definition file. The file extension that these Definition files use is .DEF

When pressed or clicked:

1. The Open Dialog box appears.

2. Select the proper drive and directory where the Definition file(s) are located.

3. Highlight the file to load and press OK or Double-Click on the file.

4. If the Definition File is in the correct format, it will load all definitions into DEF KEY.

If any of the current definitions have changed, you will be prompted to save these before loading a new set of definitions.


Save Button

The Save Button is used to save all  Definitions to a Definition file. The file extension that these Definition files use is .DEF

When pressed or clicked:

1. The Save As Dialog box appears.

2. Select the proper drive and directory where the Definition file is to be located.

3. If there are already existing Definition files in the designated drive and directory, a list of these files will appear in the File List box. Highlight the file to save and press OK or Double-Click on the file.

4. If there are no Definition files listed in the designated drive and directory, enter the proper filename, with the extension as .DEF and press or click OK. The default name for the Definition file is "untitled.def" (The file MUST be saved with the .DEF extension or DEF KEY will be unable to load it.)

The Save Button is disabled until the Text Editing box changes.


Syntax Button

The Syntax Button brings forward the Special Syntax screen for selecting a command to place in the Text Editing box for the current Definition. (See the Special Syntax Screen layout.) The explanation of Special Syntax commands can be found in that section.


Test Button

The Test Button is used to verify that the currently selected Definition will operate as expected. When pressed or clicked, the Definition will be tested. (You will notice a small box at the bottom of the DEF KEY main screen when this selection is made.)

If the Definition is clean, a message box will appear, stating that the "Definition will work". If there is a problem with the Definition, the Windows Default Beep will sound and the error box will state that it is an "Invalid Definition. Please re-check."

If the Definition is invalid, the problem is most likely the Special Syntax commands. Check these commands for uppercase and spaces.


Text Editing

The Text Editing box is used to input Definitions assigned to a particular Definition key. There is a limit of one-thousand (1000) characters that can be placed in any one Definition.

To edit a particular Definition:

1. Choose a Definition key using the Definition Key Selection.

2. Click on or tab to the Text Editing box. The cursor will be blinking in the upper-lefthand corner of the box.

3. Type in the keystrokes or Special Syntax commands that will make up this Definition (the Special Syntax commands can also be automatically placed in the box using the SYNTAX Button. See the Special Syntax Screen layout.) Normal editing keys can be used, such as Backspace, Insert, Delete, the Cursor Keys, etc. The Windows Copy, Cut and Paste feature is also available using Control-Insert, Shift-Delete and Shift-Insert, respectively.

Each Definition key has its own text; so that switching between Definition keys will also switch text.

The Text Editing box will wrap to the next line if there is not enough room on the current line to fit the text. This has no effect on the operation of the Definition. To make a Definition more readable, you can press {ENTER} to start a new line. Again this has no effect on the operation of DEF KEY.

Example:

THIS:

Hello, World{HOME}{CTRL}{INS}{END}{SHIFT}{INS}

IS THE SAME AS THIS:

Hello, World

{HOME}

{CTRL}{INS}

{END}

{SHIFT}{INS}


Special Syntax

The Special Syntax commands allow you to utilize keystrokes such as {ENTER} and {BACKSPACE} in your Definition Key Selection Definition. The commands are translated to actual keystrokes when DEF KEY is activated.

There are three rules when using Special Syntax commands:

1. The command must start with the Left Brace, {, and end with the Right Brace, }.

2. There cannot be spaces inside the braces (except as noted below.)

2. The command MUST BE IN UPPERCASE!

The repetition of commands can be performed by placing an integer value inside the braces. This is called the Repeat Count. THERE MUST BE A SPACE IN BETWEEN THE COMMAND AND THE INTEGER VALUE! The Special Syntax Screen can automatically place the Repeat Count in the command.

There are two ways to enter Special Syntax commands:

1. Enter the commands manually in the Text Editing box.

2. Use the SYNTAX Button to select a command from the Special Syntax Screen.

The Special Syntax commands are as follows:

Command	Syntax	Command	Syntax

~~~~~~~	~~~~~~	~~~~~~~	~~~~~~

Alt	{ALT}	Scroll Lock	{SCROLLLOCK}

Backspace	{BACKSPACE}	Shift	{SHIFT}

Break	{BREAK}	Tab	{TAB}

CapsLock	{CAPSLOCK}	Up	{UP}

Clear	{CLEAR}	F1	{F1}

Control	{CTRL}	F2	{F2}

Delete	{DEL}	F3	{F3}

Down	{DOWN}	F4	{F4}

End	{END}	F5	{F5}

Enter	{ENTER}	F6	{F6}

Escape	{ESC}	F7	{F7}

Help	{HELP}	F8	{F8}

Home	{HOME}	F9	{F9}

Insert	{INS}	F10	{F10}

Left	{LEFT}	F11	{F11}

NumLock	{NUMLOCK}	F12	{F12}

Page Down	{PGDN}	F13	{F13}

Page Up	{PGUP}	F14	{F14}

PrtScrn	{PRTSC}	F15	{F15)

Right	{RIGHT}	F16	{F16}


Deactivation

There are two ways to deactivate DEF KEY:

1. Double-Click on the "Active" DEF KEY Icon at the bottom of the screen.

2. Click on the "Active" DEF KEY Icon and the System Menu will appear. Press "A" or click on "Deactivate".

When DEF KEY is deactivated or closed, all Definitions are removed and any other applications that are running will have their Definition keys returned to normal operation.


Examples

Example #1: The commands below can be used with NOTEPAD. When NOTEPAD is active and the following Definition is used, the text "Hello, World" is saved to a text file in the current directory as WORLD.TXT and then NOTEPAD is terminated.

Hello, World{ALT}FAWORLD.TXT{ENTER}{ALT}FX

Example #2: The commands below can also be used with NOTEPAD. When NOTEPAD is active and the following Definition is used, the text "Hello, World" is typed, then is copied to the Clipboard with the Control-Insert combination. Then the cursor is placed at the end of the line (after the "d" in "World") and the contents of the Clipboard is appended to the line, as in "Hello, WorldHello, World".

Hello, World{HOME}{SHIFT}{END}{CTRL}{INS}{RIGHT}{SHIFT}{INS}

Example #3: The commands below evoke the Task List from the Windows Desktop when no window is active.

{CTRL}{ESC}


Acknowledgements

I thank Microsoft Corporation for having the foresight in creating Visual Basic and for providing the necessary technical documentation about the Windows API that allowed this program to exist.

I thank CompuServe for providing the necessary media in obtaining the above documentation.

I thank the Waite Group for providing an excellent Visual Basic How-To Book.

This Help file was converted to RTF format using RTFGEN by L. David Baldwin.

DEFKEY.EXE was compiled in Visual Basic 1.0  VBRUN100.DLL is required to execute this program.

DEFKEY.DLL was compiled using the Microsoft C++/Windows SDK.

DEF KEY is currently being released into the Public Domain.

Any questions or problems should be reported to:

Vernon E. Davis, Jr.

17 Bowen Avenue

Woodstown, New Jersey 08089-1403

CompuServe 71330,2705

Microsoft Windows SDK, Visual Basic and Windows are all registered trademarks of Microsoft Corporation.

CompuServe is a registered trademark of CompuServe Information Services.

Visual Basic How-To  Copyright 1992  The Waite Group, Inc.

RTFGEN  Copyright 1992  L. David Baldwin

DEF KEY Copyright 1992  Vernon E. Davis, Jr.


The About Box shows the current revision of the program.


Definition: The keystrokes and Special Syntax commands assigned to a particular Definition Key.


Definition File: The file containing Definitions that can be saved and restored for future use. The file extension is .DEF


Definition Key: The Function Keys F2 through F9 are used to send the Definitions to other applications.


Repeat Count: The number of times that a Special Syntax command will be performed. An example is {LEFT 10}, which will move the cursor ten (10) characters to the left.