home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
372.lha
/
Keys_v1.05
/
KeysDocs.pp
/
KeysDocs
Wrap
Text File
|
1990-04-01
|
24KB
|
517 lines
(*======================================================================*)
(* Program Name `Keys' *)
(* A Macro Key/Hot Key Utility for all Amiga Computers *)
(*======================================================================*)
(* Written in M2Sprint *)
(*======================================================================*)
(* Copyright © 1990 E.J. Lippert II, All Rights Reserved. *)
(* These Programs are freely redistributable as `shareware' as long *)
(* as this file is included. *)
(*======================================================================*)
(* Version: 1.05 Author : E.J. Lippert II *)
(* Date : 11-APR-90 Changes: None...(Yet) *)
(*======================================================================*)
(* *)
(* Shareware Registration: *)
(* *)
(* Users finding this program of value may wish to become registered *)
(* owners. Registered owners will recieve automatic notification of *)
(* program updates and will be elligible for customer support by *)
(* mailing their questions directly to the author. The source code *)
(* for all modules is also available to registered owners for a *)
(* minimal additional fee. Be sure to include your name, address *)
(* AND the version (as shown above) of the program that you have. *)
(* *)
(* *)
(* Send a $10.00 registration fee to: *)
(* *)
(* E.J. Lippert II *)
(* 4525 E. 2nd St. *)
(* Wichita, Kansas *)
(* 67028 *)
(* *)
(* To recieve the complete source code include an additional $20.00 *)
(* *)
(*======================================================================*)
(*************************** General Notes ******************************)
Included in this distrubition are ten files:
Arp.Library - the Arp.Library file
EdKeys - an executable program
EdKeys.info - a workbench icon for the EdKeys program
Install - an automatic installation program
Install.info - a workbench icon for the KeysInstall program
Keys - an executable program
Keys.info - a workbench icon for the Keys program
Keys.Prefs - a file containing some macro definitions
KeysDocs - the file you are reading
KeysDocs.info - a workbench icon for this file
(********************* Notes About The Programs *************************)
The function of this program is to provide short-hand definitions (called
`MacroKeys' or `Macro Initiators') that the user can define that will
automatically type in a series of key strokes (called `Macros'), just as if
they had been typed in manually. There are two main functions involved in
the creation and use of Macros/MacroKeys. The first is the actual ability
to intercept and handle the `MacroInitiator' key stroke combinations that
actuate the `Macros'. The second is the means to define the the `Macros'
and assign the Macro Initiator key stroke combinations that will cause them
to be sent.
In my Macro program, two programs are used to perform these two discrete
functions. The `KEYS' program is the program that intercepts and handles
the `MacroInitiator' key stroke combinations. And the EdKeys program is the
program that provides the means to define the the `Macros' and assign the
Macro Initiator key stroke combinations to them.
(********************* Notes About The `Keys' Program ********************)
Program Startup:
****************
The `KEYS' program may be initiated either from the Amiga Workbench by
selecting its Icon, or from any CLI window. When started up from the
Workbench the program creates its own window which will stay active as long
as the program is running. No options are allowed when the program is
started from the Workbench and the program automatically uses the
`S:Keys.Prefs' file (discussed later) as its source of Macro definitions.
When started from CLI, however, the user can specify the name of the file
containing the Macro definitions. CLI operation also provides the user with
the ability to set the priority of the `KEYS' program and, in fact, launch
several versions of the program with different Macro definitions and
priorities. (In addition to the obvious ability to load specific Macor
combinations to be used with specific programs, this feature also allows you
the unique opportunity, by using the priority setting, to set up Macros that
call or re-define other Marcos.)
The CLI format is:
FORMAT: KEYS [path|filename] [-priority]
Two Command Line Options are available:
[path|filename] is an optional directory path and/or file name to be used.
Unless specified in a command line argument, the Keys program will always
look for the `S:Keys.Prefs' file for input. If the input file (either
`S:Keys.Prefs' or a user specified file name) is not found, the program will
abort, notifying the user of the problem.
[-priority] sets the user specified of the program (ie. where in the input
chain of events the program intercepts input messages) can also be set with
a command line argument in the format `-val' where the `-' is required and
val is the numeric value of the priority from 0 to 255. The priority used
by Intuition is 50, so this program should be greater than 50, but less than
255 so as to allow other programs to exert a higher priority if needed. The
default priority is 60. (NOTE: the - (hyphen) character is required and it
must directly preceed the value with no intervening spaces.
Program Operation:
******************
While the program is active, you may temporarily inactivate the program by
pressing
<Left-Amiga><Right-Amiga><Space-Bar>
which will temporarily suspend the MacroKey functions. Pressing
<Left-Amiga><Right-Amiga><Space-Bar>
again will re-activate the program.
You may also remove the program entirely and clear all memory. If the
program was started fron the Workbench Icon, simply locate the program's
window, click in the window to activate it and then press the <CTRL> and `C'
keys. If the program was `RUN' from CLI, from any CLI, type:
Break <TASK> ALL <RETURN>
Where <TASK> is the task number assigned to the program.
(******************* Notes About The `EdKeys' Program ********************)
Program Startup:
****************
The `EdKeys' program may be initiated either from the Amiga Workbench by
selecting its Icon, or from any CLI window. When started up from the
Workbench the program creates its own window which will stay active as long
as the program is running. No start-up options are available from either
the Workbench or CLI start-up.
NOTE: The EdKeys program is just beginning to take shape and is still
missing a lot of features. Please bear with me as I work through it
as the end results should, with your help and feed back, be worth
the effort.
Program Operation:
******************
When you first start-up the EdKeys program you will be presented with the
Main program window. (This is actually two windows overlayed.) At the top
of the window there are several gadgets. From this window you may select
any of these gadgets. The following is a description of each gadget and a
sub-description of the functions available after the gadget is selected.
N/A
***
The first gadget is reserved for future use and is not yet defined.
N/A
***
The second gadget is also reserved for future use and is not yet defined.
Print
*****
One of the problems I have with Macros is that I forget them! I even used
to write out a list and keep it by my computer. This program provides you
with the ability to get a printed list of all available macros. If you
prefer you can route the list to a file which can then be edited and printed
out in whatever format you are most comfortable with.
When you select the `PRINT' gadget from the main window, you will be
presented with a file requester with the text `PRT:' in the area normally
used to display the selected directory path. If you simply select the
`O.K.' gadget, the list of macros will be sent to your printer.
Alternatively, you could provide a directory path and filename in the
appropriate areas of the requester. In this case, the list will be sent
(fully formatted) to the filename specified.
D-KEY
*****
This function is not yet implemented, but when completed, will allow you to
re-assign key values.
ADD
***
This is the Gadget to select when you want to create a new list of Marcos or
ADD Macros to an existing list. Selecting this gadget will bring up the
ADD-A-MACRO function window. To add a Macro to an existing list of Macros
you should have used the `LOAD' gadget (discussed later) to load the file
that contains the list of Macros to be extended. If no existing list of
Marcos is present, a new list will be started automatically.
The ADD-A-MACRO function window provides an easy method of selecting the
keystroke combinations that will define the Macro Initiator for the Macro to
be defined. A Macro Initiator has two parts, one part is the actual
`Initiator' key that must be pressed to initiate the Marco and the second is
a list of quafifying keys (there are 8 `Qualifiers' and they are `CTRL'
`Left Shift' `Left Alt' `Left Amiga' `Right Shift' `Right Alt' `Right Amiga'
and `Caps Lock') that must also be held down at the time you press the
Initiator key. This system allows you to define Macros for ANY key on the
keyboard (except the `Qualifier' keys) and actually assign several macros to
the same key. For example, you could assign a macro to the `F1' function
key that activates every time the `F1' key is pressed, but if you hold down
ANY of the `Qualifier' Keys the Macro will not be executed. You could then
assign another Macro to the `F1' key that only executes when the `CTRL' key
(but ONLY the `CTRL' key) is being held down, and yet another Macro could be
assigned to the `Left Shift' `Right Alt' and `F1' key combination. With 8
available qualifiers, theoretically, over 1600 `Qualifier' combinations are
possible for EVERY key on your keyboard. In reality several combinations
can't be used because they are just to awkward and others may cause unwanted
results (among other oddities, any combination that includes `Left Amiga'
`Right Amiga' and `CTRL' will cause your Amiga to re-boot), but you have
over 200 valid possible Qualifier' combinations for each Initiator key.
NOTE: The `Caps Lock' key on all key boards acts like an on-off switch,
pressing it down and releasing it sets the Caps Lock function on, Pressing
and releasing it again turns the Caps Lock function off. You DO NOT have to
hold the `Caps Lock' Qualifier key down to use it as a Qualifier. If the
Caps Lock function is on (ie. pressing and releasing the key) is all that
is necessary. The Caps Lock and Shift keys DO NOT perform the same
function, you can use both as `Qualifiers', for example `Caps Lock' `Left
Shift' `F1'. This means that you could really re-define your entire
keyboard (as a Dvorak Keyboard for exapmle) when the `Caps Lock' function is
active, leaving the keyboard totally normal at all other times.
From the ADD-A-MACRO window you MUST select an `Macro Initiator' and you may
select any optional `Qualifiers' to be used with the `Macro Initiator'. To
select the `Qualifiers', select one or more of the eight qualifiers using
either the mouse to click on the appropriate gadget, or by pressing and
releasing the corresponding `Qualifier' key. A list of the currently
selected qualifiers is displayed in the cetner of the cluster of `Qualifier'
gadgets. You may de-select a selected qualifier (delete it from the list of
selected `Qualifiers') by using either the mouse to click on the appropriate
gadget, or by pressing and releasing the corresponding `Qualifier' key.
To specify the `Macro Initiator' used to trigger this Macro, simply press
and release the desired key. The `Macro Initiator' can be any key on the
keyboard other that the 8 `Qualifier' keys. When any key is pressed, the
key will be diplayed just below the type that says `Press The Macro
Initiator Key'. To change to another key simply press another key.
When you have completed the set-up of you `Macro Initiator' select (using
your mouse) the `O.K.' gadget. If you decide to abort the ADD-A-MACRO
function, you can do so by selecting the `CANCEL' gadget. Several methods
of error checking, including checking for duplication of Macro Initiators,
has been implemented which, hopefully, will prevent any undesirable effects.
If you did not abort the ADD-A-GADGET function, you will be dropped back to
the main screen which will be used to enter the `body' text of your Macro
definition. The `body' of the Macro definition is the series of key strokes
that will be sent whenever the Macro Initiator key combination is pressed.
A Macro definition may be as simple as one key press, or may include up to
125 key strokes. (The 125 key stroke limit was put on the definition by me
to simplify programming, but because Macros can call other Macros when
running two copies of the program concurrently, there is really no limit on
the length of a Macro.)
Because any key on the keyboard including `delete' `backspace' `RETURN'
`HELP' et al can be included in the `body' of the Macro definition, and
because I haven't finished the `Editor' section of this program yet, there
is CURRENTLY no capability to edit or correct mistakes made during the entry
of a Macro definition. Be careful when you are entering long Macro
definitions.
All keyboard input consists of distinct key-down/key-up actions. As you
enter your Macro definition you will notice that when you press a key down
it is immediatly displayed on the screen. Normal characters are displayed
as normal characters and special keys are shown by pneumonic representa-
tions like <BS> for the `backspace' key and <SPC> for the Space Bar. When,
however you release the key an inverse video version of the key is printed
to the screen. (Note: Blank spaces are added for readability and will not
be present in the actual Macro definition.) For example, typing an upper
case `S' will result in a screen display of:
<LShft> s `s' `<LShft>' ;NOTE: `s' signifies inverse video s.
Notice that the s character is lowercase, this is the way it is supposed to
be, because when the Macro is played back, the computer will actually be
sent a key-down for the left-shift key followed by a key-down for the s key
before the key-up for the left-shift is recieved which will cause an upper
case S as the result.
If you try to enter more that 125 keystrokes (250 key-down/key-up)
combinations the keyboard will simply not register the additional
keystrokes. (I intend to add a warning here, but haven't done so yet.)
When you have completed entering your Macro definition, use your mouse to
select the `ADD' gadget to add the Macro to the list.
After completing the Add function you will remain in the Main screen, but
all of the Function gadgets will again be activated.
EDIT
****
This function is not yet implemented, but when completed, will allow you to
EDIT (modify) existing Macros.
KILL
****
From time to time it is necessary to delete one or more macros, the `KILL'
gadget is supplied as the tool to be used eliminate unwanted macros. When
the `KILL' gadget is selected the Kill-A-Macro window is displayed over the
main window. The Kill-A-Macro window works just like the Add-A-Macro window
described earlier. To delete a macro simply provide the Initiator and the
Qualifiers that comprise the Macro Initiator for the Macro that you want to
delete and then select the `O.K.' gadget. If deletion of the specified
Macro is successful the Kill-A-Macro window will go away and you will be
returned to the main window. If a Macro Initiator that exactly matches the
specifications you provided cannot be located a warning will be provided and
the Kill-A-Macro wimdow will remain active.
ASCII
*****
This function is not yet implemented, but when completed, will allow you to
select an ASCII representation (as opposed to the key-down/key-up represen-
tation) of the Macro definiton being edited or created. This format will
allow easier viewing of the Macro definition, but you will probably not be
able to edit the Macro definition while in the ASCII display format.
CODES
*****
This function is not yet implemented, but when completed, will allow you to
select the key-down/key-up representation of the Macro definiton being
edited or created. NOTE: This is the default mode of the display and will
only become necessary when the `ASCII' display function is completed and can
be selected.
LOAD<
*****
Selecting this gadget brings up the `world renowned' ARP File Requester with
which every one should be familiar by now. Select the file to load and you
are on your way, but because the EDIT and KILL functions are not yet active,
this function can only be used to load files to which you want to ADD
additional Macros.
>SAVE
*****
This gadget also brings up the `world renowned' ARP File Requester. Give
the file you want to save a name and you are on your way. Two items of
interest here, first I DID NOT put in any thing to prevent you from, or warn
you about saving a file over an existing file with the same name so it is
your responsibility to save with care. Second, until the EDIT function is
complete, I left in a little diagnostic routine that displays the Macro
Initiators, the Attribute value and the Macro definition on their way to the
disk. (Use the Right Mouse button to freeze the display.) Although somewhat
awkward this will at least allow you to see what's there.
(********************* Notes About The `Keys.Prefs' file *****************)
Three sample Macros are included in the Keys.Prefs file provided
with this distribution.
Initiator: Macro Definition:
<RShft><RAlt>D sys:system/diskcopy DF0: to DF1: <RETURN>
<LShft><LAlt>D sys:system/diskcopy DF1: to DF0: <RETURN>
<RShft><RAlt>E ed s:startup-sequence <RETURN>
Looking at the file with a file editor will show that:
Byte 0 - 3 = 1st Macro Descriptor
Byte 0 = Offset <n> to Start of next Macro
Byte 1 = Macro Input Event Key Code
Byte 2,3 = Input Event Qualifier Set
Byte 4..n-1 = 1st Macro of n-4 Bytes of key-dn/key-up codes
Byte n - n+3 = 2nd Macro Descriptor
Byte n = Offset <m> to Start of next Macro
Byte n+1 = Macro Input Event Key Code
Byte n+2,3 = Input Event Qualifier Set
Byte n+4..m-1 = 2nd Macro of m-n-4 Bytes of key-dn/key-up codes
Byte m - m+3 = 2nd Macro Descriptor
Byte m = Offset <p> to Start of next Macro
Byte m+1 = Macro Input Event Key Code
Byte m+2,3 = Input Event Qualifier Set
Byte m+4..p-1 = 2nd Macro of m-p-4 Bytes of key-dn/key-up codes
The Offset byte of the last Macro should be 0 indicating no more Macros.
Input Event Qualifier Set Bits:
Byte 3
Bit 8 = Numeric Pad, If desired add 1
Bit 9 = Repeat, If desired add 2 (Never Set)
Bit 10 = Interrupt, If desired add 4 (Never Set)
Bit 11 = MultiBoradcast, If desired add 8 (Never Set)
Bit 12 = Mid Mouse Button, If desired add 16 (Never Set)
Bit 13 = Right Mouse Button, If desired add 32 (Never Set)
Bit 14 = Left Mouse Button, If desired add 64
Bit 15 = Relative Mouse, If desired add 128 (Never Set)
Byte 4
Bit 0 = Left Shift, If desired add 1
Bit 1 = Right Shift, If desired add 2
Bit 2 = CapsLock Shift, If desired add 4
Bit 3 = Control Shift, If desired add 8
Bit 4 = Left Alt, If desired add 16
Bit 5 = Right Alt, If desired add 32
Bit 6 = Left Amiga, If desired add 64
Bit 7 = Right Amiga, If desired add 128
SPECIAL NOTE: If bytes 3 and 4 are both set to 255, all qualifiers will
be ignored, this allows the simple re-definition of a key
like the >< key used in the example above and will allow
it to act like any other key with LSHIFT/LALT/LAMIGA etc.
without having to define a special case for each qualifier.
If bytes 3 is set to 255 and 4 to 254, all qualifiers will
be ignored and WILL NOT have any effect on the resulting
output character. For example defining the s key as Left
Shift-S with these qualifier values will cause an upper-
case S to be output any time the s key is pressed..
NOTE: Over 100,000 potential MacroKey combinitations can be defined.
Program artificially limits total available Macro Storage to 32K.
Only 4 Bytes of overhead is required for each key combination.
Final Note: The Last Macro MUST be terminated with a CHR(0)!
************************************
* *
* Changes Documented in REV 1.06 *
* *
************************************
(*======================================================================*)
(* Version: 1.06 Author : E.J. Lippert II *)
(* Date : 14-APR-90 Changes: None...(Yet) *)
(*======================================================================*)
NOTE: ALL REV 1.06 CHANGES HAVE BEEN INCORPORATED INTO THE ABOVE TEXT.
The entries below are sinply to provide documentation of the
changes made from version 1.05 to 1.06
Changes to KEYS Program:
************************
Added HotKey: <Left Amiga> <Right Amiga> <RETURN>
This key combination can now be used to totally remove the KEYS program
from the system, flushing all buffers and freeing all memory.
Changes to EdKeys Program:
**************************
Added ` N/A ' gadget to main window.
Added ` N/A ' gadget to main window.
Added `PRINT' gadget to main window.
Added `D-KEY' gadget to main window.
Activated `KILL ' gadget allowing deletion of existing Macros.
Activated `PRINT' gadget allowing printing of a formatted list of
currently existing Macros to either PRT: or to a specified file.
Added error checking to the ` ADD ' function to prevent the creation
of a Macro Initiator that duplicates an existing Macro Initiator.
--------------------- END OF FILE ------------------------