ClockDJ - Assembly language clock, mouse, screen and window program.
Version - 3.01
Copyright - Copyright (c) by David Jenkins, 29 Nov 1988,
I can be reached at Bloom Beacon 416-297-5607.
and M31 416-439-0493
This program may be distributed freely, but please keep the
documentation and source with the load module.
Version 3.01 changes
~~~~~~~~~~~~~~~~~~~~
A number of bug fixes and minor improvements:
1. After a re-boot the key mapping used to only work after the mouse was moved.
This is fixed, so key mapping should be active as soon as the clock starts.
2. It was possible to move hidden windows; when a moved window was restored
a guru could occur. This is fixed.
3. The key combination to resize the clock window conflicted with CygnusED.
I have changed it to Left-shift+Left-Amiga+Control+up or down arrow.
4. The hide window and retrieve window conflicted with Snipit so these
have changed to Left-shift+Left-Amiga+Control+Left or Right mouse button.
5. Pressing CTRL-` (the "ctrl" key and the "`" key) is an escape for
the next key/mouse sequence entered. This will prevent translation or
macro generation on the next key/mouse sequence.
6. Left-Amiga+n will now activate a window on the Workbench screen. The
previous version required a mouse button click.
7. Left-Amiga+n followed by Left-Amiga+m will now return you to the screen
you left when you hit Left-Amiga+n.
Version 3.00 changes
~~~~~~~~~~~~~~~~~~~~
I fixed a bug in the character delay routine. The clock would stop
after a macro string with delays between the character.
Version 2.99 changes
~~~~~~~~~~~~~~~~~~~~
1. The menus have been cleaned up.
2. Submitting a string using the macro feature causes some programs
(CygnusED and Online!, for example) to choke and display incorrect
characters because the string was submitted to the input stream too fast.
I have included a new parameter at the end of the string; it specifies
a delay between the submission of each character.
3. The current date can be generated in a macro string by including "&dat", and
the current time by including "&tim".
4. All special keys can now be included in a macro string by preceding the
mnemonic with a "&". Eg.: "&del" for delete and "&ria" for right
arrow.
This gives some interesting possibilities. For example:
\lam\ria\&ria&ria&ria\r\2
will submit three right arrows each time left-Amiga right arrow
is pressed.
5. A character in a macro string may now include a qualifier: eg.,
"%lal,%ctla" would specify left alt-control-a. The qualifiers
should be separated by commas.
6. The size of the clock window can be changed by hitting
Left-shift+Left-alt+Right-shift+up arrow or down arrow.
This will allow the characters of larger fonts to be displayed correctly.
The size will be saved in the config file when "Save" is selected
from the menu.
Program Description
~~~~~~~~~~~~~~~~~~~
This utility combines a clock, mouse accelerator, screen blanker,
window manipulator, function keys and macros.
The display is a small borderless window which shows the
total memory left in the system (chip and fast) and the time in
12 hour format. The window pops to the front of the workbench
screen once every minute.
The program should NOT be started using Runback or ARun NOIO if
you plan on using the command macro function; doing so will probably
end in a guru. To start it in a start-up sequence where the CLI is to
be closed do something like this:
newcli "con:0/0/580/200/AmigaDOS " from df0:commands
endcli > nil:
"commands" is a file located on df0: containing the following:
run clockdj
Start-up parameter
~~~~~~~~~~~~~~~~~~
"r" specified as the first parameter will reverse the action of the
mouse buttons for the features that require both to be depressed.
The default is "n".
Window manipulation
~~~~~~~~~~~~~~~~~~~
The following can be selected from the menu or by clicking the correct
combination of mouse buttons:
1. Screen blanking after a pre-defined period of inactivity.
2. Pointer blanking after a pre-defined period of inactivity.
3. Mouse accelerator.
4. Sun mouse.
5. Click the window to front with the left mouse button.
6. Click the window to back by pressing the left mouse button followed by the
right mouse button, with the left button still down.
7. Cycling through screens by pressing the right mouse button followed by the
left mouse button with the right button still down.
8. Left-Amiga-m will shuffle screens if "Screen Cycle" is selected.
The button sequences for 6. and 7. can be reversed by specifying the
parameter "r" when starting the clock: eg:
run clockdj r
All the above can be selected my menus and saved in the configuration
file.
Delete Window
~~~~~~~~~~~~~
The program will allow the user to select a window and remove it
from the screen while leaving the task that started it unaffected.
To do this, point at the window you want to remove, hold the
Left-shift+Left-Amiga+Control keys down and press the left mouse button;
the window should disappear. To bring the window back hold
Left-shift+Left-Amiga+Control keys and press the right mouse button.
Up to 60 windows can be hidden in this way. When retrieving windows
the last one removed is brought back first. A separate list of hidden windows
is maintained for each screen, so only the windows for the active screen are
retrieved.
I put this feature in because my workbench screen is often cluttered
with small windows opened by tasks like VirusX. These windows serve no useful
purpose and I decided I would like a means of removing them.
Restrictions:
1. CLI windows cannot be removed. Doing so confuses things and ends in a guru,
so the CLI windows are ignored when selecting a window to hide.
2. Some programs look at their window size; FileInjector does this. If the
small FileInjector window is hidden and the hot key sequence is used, the
resulting window is smaller than it should be. The solution is one of: don't
hide this type of window; retrieve the window before the hot key; retrieve
the window after the hot key. The last option would require a window refresh
too (move the window).
3. You should use this feature with caution. Some programs don't expect
to have other tasks interfere with their windows and gurus can occur.
Generally, if the window holds only text then there will not be a problem.
Changing the window size of the clock display
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The size of the clock window can be changed by hitting
Left-shift+Left+alt+Right-shift+up arrow or down arrow. This will allow the
characters of larger fonts to be displayed correctly.
The size will be saved in the config file when "Save" is selected
from the menu.
Menu options
~~~~~~~~~~~~
NewCLI
------
Gives you a new CLI window at the bottom of the screen.
Chip/Fast
---------
This option gives chip and fast memory displays separately. When selected
the menu toggles to "Total Memory" to enable you to get back to a total
memory display.
Colour
-----
Allows you to select the colour of the clock display.
Priority
--------
The default priority of the clock is 2 which seems to work OK in most
circumstances. Setting it to 0 makes it the same priority as other
tasks started from CLI. Making it negative gives it a lower priority
than other CLI tasks. This option gives you a choice of running the clock
from -3 to +4. I found the negative values useful while running a Basic
drawing program: anything above -1 made the drawing process
jerky.
Refresh
-------
This is the maximum rate at which the program will update the display.
The default is 5 times per second and the options allow from 10 times
to once per second. I only do an PrintIText if something has changed,
so even 10 times per second does not use much CPU - you can
use pm to see how much.
Blank Screen
------------
The screen will blank after the specified time (in minutes) if there is no
keyboard or mouse activity.
Blank Pointer
-------------
The mouse pointer will blank after the specified time (in seconds) if there is
no mouse activity.
Mouse Speed
-----------
Accelerates the mouse pointer. 1 is no acceleration.
Click to front
--------------
Clicking the left mouse button in a window the specified number of
times will bring it to the front.
Click to back
-------------
Click the window to back by pressing the left mouse button followed by the
right mouse button the specified number of times.
Note that this sequence can be reversed by specifying "r" as a start-up
parameter
Sun Mouse
---------
Activates the window the pointer is above without having to click the left
mouse button.
Screen Cycle
------------
Cycling through screens by pressing the right mouse button followed by
the left mouse button with the right button still down.
Note that this sequence can be reversed by specifying "r" as a
start-up parameter
The screen cycle can also be triggered by hitting Left-Amiga-m.
Key Activate
------------
If this feature is used, the window under the pointer will be activated
when a key is depressed.
Pop to Front
------------
Selecting this item causes the clock to pop to the front of the
workbench screen once per minute.
Map Keys
--------
When checked, the key mapping and macro functions are active.
Load Keys
---------
Loads in a new set of key and macro definitions.
Save
----
If you select "Save", all the current settings, including the window
position, will be written to a file called "clockdj.config" in the
root directory of sys:. You should be careful to ensure that sys: is
assigned to the correct disk so that the file can be read when the clock
is next started.
The next time clockdj starts it will attempt to read this file and set
up the clock and associated parameters exactly as they were when you
selected "Save".
You should select this option when you are happy with the way the clock
looks, and then make sure you have the disk with the clockdj program
on it assigned to sys:.
Quit
----
Ends the program.
Macros and redefining the keys
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ClockDJ will allow you re-map the keyboard, substitute a string
of characters for a single key depression, or execute a command when
a particular key sequence is pressed. The key definitions and macros
must be created by you and saved in a file; the default file read when
the program starts is sys:clockdj.keys. The key definitions can be changed
by selecting Load Keys from the menu.
The statement format is:
\xxx,yyy\z\wwwwww\r\s\5
| | | | k c |
| | | | | | |_The delay between each character in 10ms increments.
| | | | | |
| | | | | |_ s = string; c = command
| | | | |
| | | | |_ r = replace character with the string or command
| | | | k = generate string or command, but keep the original
| | | | character.
| | | |
| | | |_ String to be generated, or command to be executed.
| | |
| | |_ Character to be re-mapped.
| |
| |_ List of qualifiers (see below), separated by commas.
|
|
|_ Delimiter.
Delimiter
---------
A "\" is the character used to delimit fields. If you wish to include
one in the string, precede it with a "^".
Qualifiers
----------
This defines which keys must be pressed with the re-map character
to generate the string or command. eg., you may want the qualifiers to be
left shift and right alt. If no qualifiers are needed to trigger the re-map,
the statement would start with a "\\".
Multiple qualifiers are specified by separating them by commas: eg.,
"lsh,lat,ctl".
The valid qualifiers are: (all in lower case)
lsh Left shift.
rsh Right shift.
clo Caps lock.
ctl Control (CTRL).
lal Left alt.
ral Right alt.
lam Left Amiga.
ram Right Amiga.
The above qualifiers must be specified in lower case.
~~~~
Character to be re-mapped.
------------------------
This field is either a single character - "w", for example - or
a string of characters which represents a single character.
If a single character is specified it must be in lower case; if you want
the upper case character re-mapped you must use two statements with
"lsh" and "rsh" qualifiers. This also applies to keys like "{", "!"
etc. whose lower and upper case representations are different.
Valid strings are: (in lower case)
f01 The function keys.
f02 |
f03 |
f04 |
f05 |
f06 |
f07 |
f08 |
f09 |
f10 V
hel Help key.
esc Escape key.
tab Tab key.
bsp Backspace key.
ret Return key.
del Delete key.
upa Up arrow.
lea Left arrow.
doa Down arrow.
ria Right arrow.
kp0 Key pad 0.
kp1 Key pad 1.
kp2 Key pad 2.
kp3 Key pad 3.
kp4 Key pad 4.
kp5 Key pad 5.
kp6 Key pad 6.
kp7 Key pad 7.
kp8 Key pad 8.
kp9 Key pad 9.
kp. Key pad ..
kp- Key pad -.
kpe Key pad enter.
kp) Key pad ).
kp( Key pad (.
kp/ Key pad /.
kp+ Key pad +.
The above keys must be specified in lower case.
~~~~
String
------
The string of characters which will replace the character to
be re-mapped.
Version 3.00 will accept special keys (del, bsp, for example) in the string.
They are specified by preceding the key name with a "&". For example,
"&del" would be delete, "&ret" would be return, etc. Any key listed above
in the "Character to be re-mapped" section can be specified in this way (still
in lower case).
Previous version of the program allowed a limited set of control characters
in the string by using the "^". This will still work. The characters
which can be defined in this way are:
^[ Escape.
^h Backspace.
^i Tab.
^m Return.
The "^" and "\" can be included in the string by preceding them
with a "^".
A character in a macro string may now include a qualifier: eg.,
"%lal,%ctla" (in lower case) would specify left-alt-control-a.
Multiple qualifiers should be separated by commas. This can be useful
for entering data in a string gadget (a file requester, for example).
The file name you want in the requester may be "myfile"; specifying
"%ramxmyfile" in the string would clear the gadget before filling it
with "myfile".
The string should appear in the active window.
Each statement can be up to 1000 characters long.
Replace/Keep
------------
An "r" causes the re-mapped character to be replaced with the
string or command. A "k" will keep the re-mapped character.
This must be specified in lower case.
String/Command
--------------
An "s" will submit the string into the input stream: it should
appear in the active window.
A "c" will execute the string as a command. A "^m" (CR) or "&ret" at the end
of the command is not needed. The command will be launched from the clock
task AT THE SAME PRIORITY AS THE CLOCK; the default clock priority is 2.
Some programs do not run well at priority 2 - eg Txed, Excellence, Blitz -
since they use input handlers running at priority 0. To avoid this kind of
problem either run the clock at priority 0 or use the ARP Arun command and
set the priority of the new task to 0.
This must be specified in lower case.
Delay
-----
Some programs will not accept a continuous stream of characters in
the input stream. CygnusED and Online! will not, for example. The delay
value will delay each character by the value*10 milliseconds. Eg.,
a value of 5 specifies 50 ms. CLI windows do not need a delay; you should
experiment to find out whether a program you are using needs the delay.
The delay field can be between 0 and 9.
If the delay is ommitted, a delay of 0 is assumed.
Examples
~~~~~~~~
\\f01\arun >nil: <nil: stack 4096 pri 0 ed\r\c
Will run ed as a task at priority 0. Notice that no qualifier was specified
for the function key F1. The redirection to nil: is to prevent unwanted
messages in the console window.
\ctl,lsh\f01\dir df0:\r\c
When CTRL, left shift and F1 are depressed a dir df0: will execute and the
result will appear in the window belonging to the cli which started ClockDJ.
\lal\t\arun >nil: <nil: stack 16000 pri 0 Terminals:gt/gt\r\c
Run GT when left-alt t is depressed.
\lal\esc\newcli <nil: >nil:\r\c
Start a new cli when Left-alt esc is depressed.
\lal\n\David Jenkins\r\s\5
Submit the string when left-alt n is depressed and insert a 50 ms delay
between each character.
\lal\m\Inter-Office Correspondence^m^mFrom: David Jenkins^m^mTo:^m^mSubject:^m^m______________________________________________________________________________^m^m\r\s\5
Submit the string when left-alt m is depressed and insert a 50 ms delay
between each character..
\clo\`\~\r\s
\clo\1\!\r\s
Convert Caps lock "`" and "1" to "~" and "!".
\lal\f\%ramxdf0:file1\r\s
Is useful for putting a string into a requester. The "%ramx" will submit a
Right Amiga-x which will clear the string gadget before submitting the