home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 2
/
FFMCD02.bin
/
new
/
amigalibdisks
/
disk933
/
editkeys
/
editkeys.doc
< prev
next >
Wrap
Text File
|
1993-12-21
|
23KB
|
522 lines
EditKeys v1.4
-------------
©1991-93 David Kinder
---------------------
Introduction
------------
Around late 1990, I was trying to find a program to allow me to edit the
system keymap files. There were a few that let you put strings on keys, but
none gave total control over all the features of keymaps. So I decided to
write my own editor. I mean, how hard could it be..?
The result is EditKeys, a keymap editing program designed to work under
AmigaDOS 1.3 and higher. EditKeys is written in machine code and compiled
using HiSoft's Devpac v3 assembler, though it should not be that difficult
to compile under other assemblers. EditKeys is freely distributable,
provided that no more is charged than a nominal fee for copying and disk
media. If you want to use a keymap created with EditKeys in a PD or
commercial package then the only condition I impose is that I receive a
credit somewhere in the program or its documentation.
Files
-----
Program - EditKeys
EditKeys.info
Documentation - EditKeys.doc
Disk Libraries - arp.library (must be in LIBS: for AmigaDOS 1.3)
asl.library (must be in LIBS: for AmigaDOS 2.0+)
Source files - EditKeys.s
Graphics.s
xdef.i
xref.i
Tech.Notes
About EditKeys
--------------
EditKeys allows you to edit or create keymap files (They are found in the
Devs/Keymaps/ directory of the boot disk. If you don't know about these
files, then perhaps I should explain.
When you press a key on the Amiga's keyboard, the key press is translated by
the keymap file that the system is using. For instance, British Amigas use
the keymap 'gb'. Different keymaps can be found on the system disks
supplied with your Amiga. They are found in:
AmigaDOS 1.3 Extras1.3:Devs/keymaps/
AmigaDOS 2.0 Extras2.0:Devs/Keymaps/
AmigaDOS 3.0 Storage3.0:Keymaps/
Under AmigaDOS 2.1 and higher keymaps have icons, and are loaded into the
system with the Input prefs editor (or the SetKeyboard command). With
earlier releases, keymaps are loaded with the SetMap program, found in the
System drawer of the boot disk. If you load a keymap different to your
native one, you will find typing some keys gives unexpected results
(especially the non-alphanumeric keys (eg. [,;,# )).
Keymaps can be changed to give more radical results; you could redefine the
numerical keypad to produce alphabetic characters if you wanted to, or you
can configure keys to output strings (useful for disk-menus etc.).
Please note that any changes made using EditKeys do NOT come into effect
until you load the keymap via the system software; only when you select
'Save' in EditKeys is a suitable keymap structure constructed and saved to
disk so that AmigaDOS can use it.
Keymap Specifications
---------------------
At this point, perhaps I should define some of the terms I will use:
Qualifier Key - CTRL, ALT or SHIFT keys. Do not produce output on their
own but qualify the output of other keys (eg Shift-f
produces 'F').
Physical Key - An actual key on the keyboard, the thing that you touch
when you type.
Key - A combination of a physical key and a qualifier, eg q is
a key, as is Shift-q, Alt-q, Shift-Alt-q, etc. Note that
Alt-q is an abreiviation for holding down the ALT key
while tapping the 'q' key.
Keymaps contain quite a lot of information, none of which appears in the user
manuals but appears in the RKM under 'console.device' (Makes sense to put
info about the keyboard in a programmer's manual eh?). Therefore I shall
attempt to briefly describe what is possible.
Keys can be redefined to produce any character when pressed with one of the
qualifiers, and also keys can produce strings of up to 32 characters.
Physical keys with a STRING key on them may not have DEAD or MODIFIABLE keys
on them (see below).
Some keys repeat when held down (eg all alphabetic keys), while others do not
(eg the <RETURN> key). Physical keys which repeat are referred to as
REPEATABLE (fairly obvious). Whether a key repeats or not is controlled by
the keymap. Similarly, the keymap controls whether a key is CAPSABLE or not.
When the 'Caps Lock' light is on, some keys produce their Shifted values (eg
'q'), while the numerical keys produce their normal values.
Some keys are DEAD, while others are MODIFIABLE. For an example of this, open
a CLI window, then hold down ALT while tapping the 'f' key (From now on
abrieviated to Alt-f); nothing happens. Now tap the 'a' key, the result is
an a with an accent over it: 'á'. The key Alt-f is a DEAD key, while 'a' is a
MODIFIABLE key. When you type Alt-f, the Amiga stores the deadkey, which it
then uses to modify the output of the 'a' key. Not all keys are MODIFIABLE,
Alt-f followed by 'q' just produces 'q'. A physical key with DEAD or
MODIFIABLE keys on it may NOT have STRING keys on it.
There is a further limitation in that those physical keys that are not DEAD
or MODIFIABLE use only 4 bytes for their definition, eg on the 'A' key on
your keyboard there is 'a', 'A', 'æ' and 'Æ'. However, there are 8 different
permutations of the Shift, Alt and Control qualifiers with the key, so not
every combination of physical key with qualifier can be uniquely defined.
Why didn't Commodore use 8 bytes for each key? (sigh). There is one other
point; if a physical key has definitions for Shift and Alt (and thus
Shift-Alt) then we can configure the key so that the Control qualifier
outputs the value that would appear without the Control key being pressed,
but with bits 6 and 7 cleared (eg Control-c). Confused? You're not the only
one... But playing around with EditKeys should make all this clear (or at
least clearer than it is at present).
It is worth noting before I start on a discussion of EditKeys that once you
have loaded a keymap into the system, you cannot replace it with another
of the same name using SetMap or SetKeyboard. This is because the system
expects keymaps not to change. The solution to this is to use the supplied
'LoadKeymap' command.
The Program
-----------
EditKeys allows you to modify all the above features of a keymap. Keys may be
made DEAD or MODIFIABLE, or have STRING definitions put on them, as well as
being redefined. The program may be started from CLI or Workbench:
From Workbench: Just double click on the program's icon. A file requester
will appear for you to select a keymap to load. Click on
a keymap or 'Cancel'.
From CLI: 1) Just type the program's name, ie
1> EditKeys
The program will attempt to display a file requester
prompting you for a keymap to load. Select a keymap or
click on 'Cancel' to start the program without a keymap
loaded. Or,
2) Pass a keymap name to the program, ie.
EditKeys [<keymap>] [NOMAP]
eg 1> EditKeys gb
or 1> EditKeys NOMAP
You do not need to specify the path of the keymap as
EditKeys will automatically look in DEVS:keymaps/. If
you specify the NOMAP option then EditKeys will start
without loading a keymap. Or,
3) Enter the line
1> EditKeys ?
Which will bring up a template. Entering a further ? will
prompt you with a small help message. Enter a keymap name
or NOMAP (see above).
When the program has loaded it will open a window on the Workbench screen.
In the titlebar is the name of the keymap being edited; below that is a
representation of the A500/A2000/A1200 keyboard with the keymap you chose.
Note that it may appear to you that the keyboard has acquired two extra keys
(one to the right of the left Shift key and the other to the left of the
Return key), as these are not present on the older UK and US Amigas.
Furthermore, the representation of the keymap usually shows what is output
by that key, but for certain keys (eg Esc, Help, Del, F1-F10) I have chosen
to use a little graphic which never changes as this looks better. If you need
to be certain what a key outputs, click on it; its output will be displayed
at the bottom to the EditKeys window.
Qualifier keys (Shift etc.) displayed on the screen work as expected; click
on Shift to see the effect. The program is run using the menus and the five
mode gadgets displayed below the keyboard; each gadget represents a different
aspec