home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
266.lha
/
SetKey_v2.0
/
Tutorial.doc
< prev
next >
Wrap
Text File
|
1989-07-10
|
7KB
|
104 lines
SetKey
The new command SetMap (V1.2) allows the use of different keyboards or the
total reconfiguration of a keyboard! Alas, the only keymaps available are
for foreign keyboards or the Dvorak keyboard. Wouldn't it be nice if you
could reconfigure a keyboard to suit you needs? SetKey allows you to do just
that and a whole lot more. SetKey is a keymap editor that allows up to eight
strings to be assigned to most keys on the keyboard. Also characters can be
entered in HEX so that maximum flexibility is maintained. The SetKey keymap
editor is easy to use, easy to learn and best of all compatible with SetMap.
SetKey can be used from WorkBench or the CLI. If SetKey is run from the
CLI, a keymap that is stored in DEVS:keymaps/ can be used as an argument. If
no keymap is specified then the current default keymap is used. When SetKey
is run, it presents the user with a diagram of the keyboard with all the keys
ready to be edited. Using SetKey starts with selecting a qualifier, if any,
then a key to edit.
For anyone unfamiliar with the concept of qualifiers, there are three
qualifiers on the Amiga keyboard, shift, alt, and control. Any time that you
hold one of the qualifier keys and press another key, the code which is sent
to the computer includes the qualifier. This code is then translated by
looking up (in the keymap!) the code and qualifier, and the translated code
is finally sent to the application as a character or a string of characters.
Since there is no restriction placed on the characters in the keymap, keys
may "map" to strings containing carriage returns or other control codes, so
that a single keypress can be made to perform several commands. In addition,
qualifiers may be combined (e.g. shift+alt or shift+alt+control) making a
total of eight different strings for each key. SetKey supports the mapping
of all eight combinations with either characters or strings. Now that we
have explained what SetKey does, lets examine how it works.
To get familiar with SetKey, run the program from either CLI or WorkBench.
First press the letter "a". Notice the a key on the keyboard picture is
highlighted, and a box appears at the bottom of the screen with quite a bit
of information in it. At the top of this box are three fields, indicating
the key selected, its internal code value in hexidecimal, and any qualifiers
currently selected. Note that the current display shows "none" for the
qualifiers, since we did not press any qualifier keys before we pressed the
"a" key. To indicate a qualifier, simply press the desired qualifier(s)
BEFORE selecting the key you intend to edit. This action will highlight the
qualifier(s) you select, and when you subsequently press a key to edit, you
will see the qualifiers in the third field of the first line in the box. In
the center of the box is a long string gadget containing the letter "a".
There is a short string gadget in the bottom left corner, used for entering
characters in hex. There are two more gadgets in the box, the "Modify
Keymap" gadget and the "Cancel" gadget. Use the mouse to point at the Cancel
gadget and press the select mouse button. The box will disappear and the a
key will return to normal on the display. Now lets actually map a string to
the shifted f1 key and test it in the CLI.
First press any shift key on the keyboard (you may point at the keys in
the display and press the select button on the mouse if you prefer). All the
shift keys on the keyboard should be highlighted. Now press the f1 key (or
point and click). The box will reappear at the bottom of the display with 4
characters in the long string gadget in the center of the box. The 4
characters should be an escape character (which Intuition displays in string
gadgets as a tall box shaped character) then "10~". We are going to replace
this relatively useless string with one that actually does something. First
click in the long string gadget to activate it. The cursor will be displayed
inside the gadget. Delete all the characters in the box and then type "cd
df0:" without the quotation marks. Now we would like to set up our new
shifted f1 to perform the cd df0: without having to press return after we
press shift f1. To do this, we need to include the "return" at the end of
our string. But pressing return now causes the display to blink and include
a return in the string with the cursor placed one character to the right
ready for more input.
The hex entry gadget allows you to type in a hex number, which is
translated into a character and placed in the string at the current cursor
position, replacing whatever was previously there. Start by getting the
cursor to the end of the long string gadget. Now point at the hex gadget and
press the select button. The value displayed to the right of the hex gadget
should change to 00. This is the value in hex of the character at the end of
the string in the long string gadget. Type whatever HEX value you want, if
any, at the current cursor location and hit return. Then click back on the
string input gadget to continue input. Notice that a tall box appears at the
end of the long string gadget. SetKey has replaced the 00 with the HEX value
you have entered. Now that we have finished modifying the key, let's store
it in the temporary working keymap by clicking on the Modify Keymap gadget.
You may repeat this process for other keys on the display until you have
the keys "mapped" according to your own preferences. The new keymap may now
be saved by pulling down the Main Control menu and selecting "Save a keymap
to the disk". When you do this, another box will be displayed with a
directory string gadget and a filename string gadget in it. The directory
string gadget points to DEVS:keymaps by default. This is the directory that
setmap will look in later when we activate our keymap, so it is best to put
all of your new keymaps here. Type in "example" in the filename gadget and
click on the Save gadget. If your DEVS:keymaps disk has room and isn't write
protected, the file will be stored. To exit, you may either click on the
closewindow gadget or use one of the exit options from the main menu. Now
we're ready to activate the new keymap. From the CLI, enter "setmap
example". Your keymap has now been activated. To see it work, hold shift
and press f1. The CLI should do cd df0: for you. Try out any other keys you
have mapped. That's all there is to it. You are free to make further
modifications by using SetKey again, but be aware that setmap will not
replace a keymap which has already been activated. If you make changes with
SetKey and store under the same name, setmap will simply reactivate your
first version of the keymap. The only way to activate a new version with the
same name is to reboot the Amiga and then do setmap again.