Dec 052017
Allows Turbo Professional owners to change key definitions in TP units.
File TPKEYS.ZIP from The Programmer’s Corner in
Category Pascal Source Code
Allows Turbo Professional owners to change key definitions in TP units.
File Name File Size Zip Size Zip Type
TPKEYS.DOC 6443 2606 deflated
TPKEYS.PAS 43688 10077 deflated

Download File TPKEYS.ZIP Here

Contents of the TPKEYS.DOC file

TPKEYS - Keyboard installation program for Turbo Professional 5.0
TurboPower Software
Version 5.04
Released to the public domain

TPKEYS serves two purposes. The first and most obvious is to provide a
convenient and easy means of customizing the key assignments in several Turbo
Professional units: TPEDIT, TPENTRY, TPHELP, TPMENU, and TPPICK. The second is
to demonstrate how to write an installation program using the TPCLONE and
TPCMD units.

When you start TPKEYS, it will try to open five files:


If any one of these files cannot be found, it will abort with an error
message. Although it is best to change to the directory containing the TPU
files before running TPKEYS, the files will always be found as long as they
exist in a directory on DOS's PATH.

After the files have been opened, you'll see a main menu displaying the names
of the five units. Move the menu highlight to the name of the unit whose key
assignments you wish to modify and press . (If you have a mouse, you
can move the mouse cursor to the appropriate menu item and click the left
mouse button instead.)

The middle portion of the screen will then show a list of key assignments for
the unit. The far left column shows the name of each command, and the next
three columns show the current key assignment(s), if any. Each command may
have a maximum of 3 key sequences assigned to it, and each sequence may
contain a maximum of 6 keys (keys with extended scan codes, such as and
, count as 2 keys).

To add or change a key assignment, move the cursor to the appropriate row and
column, then press . (You can also use a mouse to move the cursor.
Clicking the left button once moves the cursor to the item pointed to by the
mouse, and clicking it a second time selects the item for editing.) The key
editor will then be displayed in a popup window in the middle of the screen.

Within the key editor, the following keys and mouse buttons have special

Delete previous char.

Clear key assignment.

Restore; cancel changes and keep editing.

Accept key assignment.

Cancel edits and exit from editor. Pressing any mouse button combination
involving the center button (on a three-button mouse) will also execute
this command.

Toggle between Command and Literal mode. can be used only
while in Command mode.

In Command mode, the default, the key and mouse button combinations listed
above perform the functions as described. In Literal mode, only
has any special meaning; all other key and mouse button combinations are
inserted into the key string being edited.

Although the behavior of the key editor is quite intuitive, there are a couple
of things that you should keep in mind when using it. First, "normal keys"
(alphabetic and numeric characters, punctuation marks, , etc) should
almost never be used for commands. (The only real exceptions to this rule are
the "Increment choice" and "Decrement choice" commands in TPENTRY.) To
discourage use of some of these keys, the key editor translates alphabetic
characters into their control-key equivalents: e.g., is translated into
<^A>. Second, you should be especially careful when editing commands with the
word "mouse" in their names. These commands should be assigned only to mouse
button combinations, not to keys.

After you have made your changes to a given set of commands, press or
to return to the main menu. TPKEYS will then take a few moments
to analyze the edits that you've made. The first thing it will do is to check
for conflicting key assignments. For example, if one command were assigned to
<^Q> and another to <^Q><^W>, or if two commands were assigned to the same key
combination, a conflict would arise. All conflicting key assignments would
then be highlighted, and you would be given an opportunity to resolve the
conflicts. TPKEYS will also check to insure that there is room in the
installation area of the unit for all the key assignments that you've
selected. If there isn't enough room, an error message will be displayed, and
you'll be given an opportunity to eliminate unnecessary key assignments in
order to make more room.

Once you're back at the main menu, you'll have two choices. You can either
select another unit for editing, or you can press or to
exit from the program. When you do decide to exit, TPKEYS will check to see if
any key assignments have been changed. If any changes were made, you will be
asked to confirm that you want to "Install changes permanently". Press to
save your changes, or to cancel them. Assuming that you answer Yes, TPKEYS
will then modify the installation areas in all units where changes were made.
(Note that the date/time stamps on the modified TPU files will not be changed.
TPKEYS preserves the old date/time stamp to try to prevent unnecessary

TPKEYS as Model
As indicated earlier, part of our purpose in providing this program is to give
you a model to use when creating your own programs. In one key respect,
however, TPKEYS is an atypical model.

Most installation programs modify only a single file. TPKEYS works with five,
and much of the complexity of TPKEYS is due to the fact that it is, in a
sense, five installation programs in one. Please try to keep this in mind when
studying the source code for the program. TPKEYS would be much smaller and
simpler if it only had to work with a single file. If you intend to modify
TPKEYS for use with one of your own programs, a good first step might
therefore be to trim the program down to the point where it works with only a
single file. Once you've done that, you should have a much better idea about
how to add the additional features that you need for your particular

Leave a Reply