home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 487.lha / KeyMapEd_v1.2 / KeyMapEd.doc < prev    next >
Encoding:
Text File  |  1991-03-11  |  14.1 KB  |  346 lines

  1.                Key Map Editor
  2.                  Tim Friest
  3.                  March 1991
  4.  
  5.                 version 1.2
  6.  
  7. ***************************************************************************
  8. * The KeyMapEditor is copyright © 1989,1990,1991 to Tim Friest          *
  9. *                                      *
  10. * this program is FREE, you may copy it or distribute it as long as there *
  11. * is no charge for the program (small handling fees are allowed if this   *
  12. * program is distributed on a disk with other PD/FreeWare/ShareWare      *
  13. * programs or on a charge BBS), and the executable is unaltered and this  *
  14. * file accompanies it.                              *
  15. *                                      *
  16. * please send any and all comments and/or bug reports to:          *
  17. *                                      *
  18. * USMail:    Tim Friest                          *
  19. *        3861 Steller Dr.                      *
  20. *        Anchorage, AK 99504                      *
  21. *                                      *
  22. * Internet: FRIEST@ELMENDORF-AC2SMAN.AF.MIL                  *
  23. *                                      *
  24. * bix:        TFRIEST                              *
  25. *                                      *
  26. * Voice:    (907) 333-8199                          *
  27. *                                      *
  28. * Compiled with Lattice C 5.10a (1.3 includes and libraries)          *
  29. *                                      *
  30. ***************************************************************************
  31.  
  32. Introduction:
  33.  
  34. KeyMapEd allows you to modify the KeyMaps destributed by Commodore-Amiga
  35. with AmigaDOS.  These KeyMaps may then be installed on your system with
  36. the SetMap command.
  37.  
  38. Basically, any key may have 'key macros'.  Each key may have a seperate
  39. value for pressing the key alone, with shift, with alt, with shift & alt,
  40. with control, with control & shift, with control & alt, and with shift, alt,
  41. & control (the latter is refered to as vanilla).  Thus, each key may have up
  42. to 8 seperate values when pressed.  Further, keys may be capsable (use the
  43. shift value when the caps lock key is on) and/or repeatable (key repeats
  44. when held down).  Finally, pressing the combination of a dead key with a
  45. key that is deadable (modified by a dead key) allows the addition of accents
  46. to the key value (for instance an 'alt-g' then 'a' will produce an 'à' or an
  47. 'a' with an accent grav '`' above it).
  48.  
  49. Any program which is written correctly and uses the default keymap will
  50. fully support all these features and fully support any changes you make
  51. to your keymap.  Unfortunately there are many programs which are not written
  52. correctly and/or do not use the default keymap (hint! hint! developers!!!).
  53.  
  54. I believe that with this utility, it will be much easier to write a program
  55. which uses a special keymap, and still fully support the keymap capabilities,
  56. than to hardcode what each key does within the progam.
  57.  
  58. Note:    SetMap adds the keymap to a list in memory and if you do
  59.  
  60.         SetMap usa1
  61.         SetMap f
  62.         SetMap usa1
  63.  
  64.     SetMap will only read usa1 once!  Further, usa1 and f will both
  65.     remain in memory until you reboot.
  66.  
  67.     This impacts KeyMapEd since modifying a keymap that you've already
  68.     done a SetMap on, then trying to SetMap it again, will not update
  69.     the keymap in memory (it will just use the version it had already
  70.     loaded into memory).   You would have to save the keymap out under
  71.     a different name from KeyMapEd to get SetMap to use the new version.
  72.     The name is hardcoded in the file, so it is recommended you do not
  73.     rename the file.  The reason for this is that SetMap compares the
  74.     name within the file to the keymap that is requested, and if it is
  75.     the same, the version already in memory is used.  Supose you edited
  76.     the usa1 keymap, saved it as usa1 and then renamed it to foo.  Then
  77.     you changed your Startup-Sequence to do a SetMap foo instead of
  78.     SetMap usa1 (which is normal for A500/A2000s).  The system still
  79.     thinks that the keymap it has loaded is usa1 (not foo) since that was
  80.     the name coded in the file... For this reason, doing a SetMap usa1
  81.     will not load in usa1, but use the one in memory (which is really foo).
  82.     Also, SetMap foo will load another copy of foo into memory since
  83.     foo doesn't match usa1.
  84.  
  85.  
  86. ROM keymap:
  87.  
  88. If you select 'ROM' as the file name of the keymap you wish to edit, you will
  89. get the default keymap (which will be the one in ROM if you have not already
  90. done a SetMap).  You can edit it and save it out under any name you wish.
  91.  
  92.  
  93. Description:
  94.  
  95. There are four basic types of keys definable within a keymap.
  96.  
  97.  
  98. NOP
  99.  
  100. A NOP key does nothing, and has no value.
  101.  
  102.  
  103. Normal (NoQual)
  104.  
  105. A normal key may contain up to 4 single character values (plus a special
  106. value for vanilla keys).  This format uses the least amount of space, so
  107. you should use this if possible (as apposed to the next two).
  108.  
  109. The four values can correspond to any combination of the key alone with
  110. up to two of the shift/alt/ctrl combinations.  If you want the key to be
  111. vanilla, the ctrl key modifies the value of certain alphabetic keys plus
  112. some others (@ for example), giving you 5 values for that key.  For example
  113. the 't' key contains the values 't', 'T', alt-t '\xfe', alt-T '\xde', and
  114. ctrl-t '\x14' (note the ctrl-t value isn't actually stored, it is calculated,
  115. bits 5 and 6 are cleared from the value)
  116.  
  117. String
  118.  
  119. A string key may contain all 8 possible values, and each value may be up
  120. to 32 (as of AmigaDOS v1.3) characters in length.  A good example of string
  121. keys are the function keys, the arrow keys, or the application keys.  These
  122. keys will send a string whenever the key is pressed.  This is basically what
  123. will give you that 'key macro' capability.  Any key which is not dead or
  124. deadable may be string and output up to 8 different 32 character values
  125. when pressed.  Therefore, if you want alt-f10 to issue a 'list dh0:" command
  126. you could simply code that into the keymap.
  127.  
  128.  
  129. Dead
  130.  
  131. Dead keys output up to a single character in one of three ways.  A key that
  132. is dead (when you press it it modifies the value of the next key pressed), a
  133. key that is deadable (modified by a dead key), and a key that is uneffected
  134. by a dead key.  If a key is dead, it contains the value of the accent that
  135. it will use (for instance alt-k will produce an umlat with deadable keys).
  136. If a key is deadable, seperate values will be stored for each possible accent
  137. available on that key (there are currently five: accent accute (´), accent
  138. grav (`), caret (^), circumflex (~), and umlat (¨) (I produced these by
  139. pressing alt-f space, alt-g space, alt-h space, alt-j space, alt-k space with
  140. the USA1 keymap)).  Finally, if the key can not be modified by a dead key,
  141. then simply place the value in the keymap (for instance an alt-a is not
  142. modified by a dead key).
  143.  
  144.  
  145. Using KeyMapEd:
  146.  
  147. KeyMapEd will prompt for a keymap if you do not specify one.  It auto-
  148. matically assumes the keymap is located in devs:keymaps so you must specify
  149. the full pathname if it is not located there (SetMap requires the keymap
  150. be in devs:keymaps so you might as well put them there anyway).
  151.  
  152. The KeyMapEd window is very similar to KeyToy and should display the current
  153. value for each key with the current combination of shift/alt/ctrl/capslock.
  154. Simply press the shift/alt/ctrl/capslock gadgets to change the display.  The
  155. keyboard displayed is that of an Amiga 2000.  The keymap for an Amiga 500 or
  156. 1000 is exactly the same!  The A2000 keyboard has a few additional keys
  157. that the A1000 did not, and some of the keys have migrated, but other then
  158. that, the keymap for ALL keys on the A1000 keyboard is exactly the same as
  159. that for an A2000, there are just fewer values on the A2000 keyboard listed
  160. as unused (i.e. there are still spaces left so an A3000 might very well have
  161. even more keys then the A2000 and still be fully compatible with the A1000
  162. (at least keymap wise)).
  163.  
  164. Clicking on a key gadget other then the shift, alt, ctrl, or capslock will
  165. display the key editor window for that key.  Pressing the key on the keyboard
  166. will also work.
  167.  
  168. The top row of gadgets define what type of key this is (NOP, Normal, String,
  169. or Dead).  The second row shows which of the shift/alt/ctrl keys effect this
  170. key.  The third row displays whether the key is capsable and/or repeatable.
  171. Finally the rest of the window shows the values for each of the shift/alt/ctrl
  172. combinations available for this key.  The rest of the window will be different
  173. depending on whether the key is NOP, Normal, String, or Dead.
  174.  
  175. Values for a key will be displayed in standard C string format.  This means
  176. that if the value is normally printable, the value should appear, otherwise
  177. the hex value for the key will be displayed in the format '\x##'.  A few
  178. notable exceptions to this rule are certain of the common control codes have
  179. special values '\r' for return, '\n' for newline, '\f' for formfeed, etc.
  180. Finally, since the '\' is used as an introducer for the control sequences,
  181. you must use '\\' to specify a single backslash.
  182.  
  183. Since up to 4 characters may be used to specify a single character value,
  184. the string gadgets for a single value may hold up to 4 characters.  Please
  185. note that Normal keys and dead keys may contain 1 and only 1 value, and if
  186. you place more characters in the string gadget then what will equate to
  187. a single character, the string will be truncated to 1 character.  Likewise,
  188. String keys may only contain 32 characters, I have made the string gadget
  189. size 127 to hold many control sequences.  Again, the resultant string will
  190. be truncated to 32 characters.
  191.  
  192. Switching back and forth betwean the types of keys (NOP, Normal, String, and
  193. Dead) will produce strange results as strings are truncated to fit within
  194. certain limits or altered as dead or deadable keys.
  195.  
  196. Selecting either the Use or Cancel gadgets will end the key edit mode and
  197. either update the keymap or not depending.
  198.  
  199.  
  200. Saving the KeyMap:
  201.  
  202. Once you have gotten the keymap as you like, you will want to save it.
  203. Selecting the Save option from the Project Menu will give you a file requester
  204. which you may use to save the keymap either to the same filename as read or
  205. a new filename.  Again the default directory is devs:keymaps, and you must
  206. specify otherwise if you desire it to be elsewhere.
  207.  
  208. Note: The Key Map Editor uses the filename as the node name of the keymap,
  209.       thus if you save a keymap as USA1 the system will not differenciate
  210.       betwean the real (system) USA1 and your modified version, but if you
  211.       save it as NEWUSA1, the system will always see it as NEWUSA1 even if
  212.       you rename the file to USA1.  This is important to remember because
  213.       of the way SetMap works (see note at top).
  214.  
  215.  
  216. ---------------------------------------------------------------------------
  217.  
  218. Changes to v0.99 since v0.91:
  219.  
  220.     Fixed bug with interpretation of Vanilla keys for normal type
  221.  
  222.     Added options in options menus
  223.  
  224. ---------------------------------------------------------------------------
  225.  
  226. Changes to v1.0 since v0.99:
  227.  
  228.     Center text within gadgets on keyboard display
  229.  
  230.     Fixed return key (used Masked Boolean gadget so all of key
  231.     highlights when selected)
  232.  
  233.     Modified CTRL and CapsLock keys so rapidly and repeatly clicking
  234.     them would not continually refresh the screen (this already worked
  235.     on Shift and Akt keys)
  236.  
  237.     Fixed problem with key labels for NOP keys which causes GURUs
  238.  
  239.     Fixed a problem with deadable keys which were not Vanilla
  240.  
  241.     Fixed title/version number
  242.  
  243. ---------------------------------------------------------------------------
  244.  
  245. Changes to v1.01 since v1.0:
  246.  
  247.     Fixed a major bug when converting from one type of key to another
  248.     (for instance editing a normal key and changing it to a string
  249.     key caused a GURU)
  250.  
  251.     Fixed a problem with the key label centering code (didn't update
  252.     properly).
  253.  
  254. ---------------------------------------------------------------------------
  255.  
  256. Changes to v1.02 since v1.01:
  257.  
  258.     Fixed the Return key to not overright the ] when edited
  259.  
  260. ---------------------------------------------------------------------------
  261.  
  262. Changes to v1.03 since v1.02:
  263.  
  264.     Increased size of filename allowed by file requester to support
  265.     longer pathnames (i.e. keymaps outside of devs:keymaps)
  266.  
  267.     Fixed the Load and New options so that the modified requester
  268.     appears if the current keymap has been changed
  269.  
  270.     Fixed the file requester files list to stay where it was left
  271.  
  272.     Added a Reload gadget for the file requester so that the list
  273.     could be updated if things changed externally to the program
  274.  
  275.     Fixed guru which appeared when saving more then once
  276.  
  277. ---------------------------------------------------------------------------
  278.  
  279. Changes to v1.04 since v1.03:
  280.  
  281.     To fix guruing problem with 1.03, I simply recompiled it (no other
  282.     changes except version number...)
  283.  
  284.     Fixed Shift-Alt dead key to allow modified values
  285.  
  286.     Fixed copy/move to clear key before operation (free mem for
  287.     string/dead)
  288.  
  289.     Fixed copy/swap/move capsable and repeatble flag setting
  290.  
  291.     Fixed deallocation problem for keycodes 0x3F and 0x77
  292.  
  293. ---------------------------------------------------------------------------
  294.  
  295. Known Bugs/Features: v1.04 March 15, 1989
  296.  
  297.     String gadgets don't erase the last character when scrolled to the
  298.     right.  Seems to be a bug with intuition???
  299.  
  300.     Return key gadget erases part of ] key on refresh
  301.  
  302.     Clicking a gadget for the key editor requestor before it has finished
  303.     rendering will cause the computer to lockup
  304.  
  305. ----------------------------------------------------------------------------
  306.  
  307. Changes to v1.1 since v1.04
  308.  
  309.     Added key entry support to define a key (just press the key instead
  310.     of clicking on the gadget with the mouse).  This will allow support
  311.     for any key which is definable (for non-standard keyboards or future
  312.     keyboards with extra keys).
  313.  
  314.     Fixed return gadget using a masked boolean gadget.
  315.  
  316.     Fixed lockup problem.
  317.  
  318. ----------------------------------------------------------------------------
  319.  
  320. Changes to v1.1i since v1.1
  321.  
  322.     Added menu option to switch between European and American (English?)
  323.     keyboards.  Added gadgets and support for extra keys.
  324.  
  325. ----------------------------------------------------------------------------
  326.  
  327. Known bugs in v1.1i
  328.  
  329.     Does not support Double-Dead keys.  I hope to add this sooner than
  330.     it has taken me to add the extra keys for European keyboards.
  331.  
  332. ----------------------------------------------------------------------------
  333.  
  334. Changes to v1.2 since v1.1i
  335.  
  336.     Added support for using the ROM keymap so you can load it in and
  337.     edit it (you have to save it out as a file of course).
  338.  
  339.     Fixed a bug for normal keys with values greater than 0x7F (why is
  340.     char a signed byte????)
  341.  
  342.     Kludged a fix for my error messages.  Since I write to Output()
  343.     with DOS, if you start from Workbench, there is no output defined
  344.     so I GURUed...  I now start from workbench with IconX to insure a
  345.     an Output.  Hopefully I will unkludge this sometime in the future.
  346.