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 >
Text File  |  1989-07-10  |  7KB  |  104 lines

  1.  
  2.  
  3.                                     SetKey
  4.  
  5.    The new command SetMap (V1.2) allows the use of different keyboards or the
  6. total reconfiguration of a keyboard!  Alas, the only keymaps available are
  7. for foreign keyboards or the Dvorak keyboard.  Wouldn't it be nice if you
  8. could reconfigure a keyboard to suit you needs?  SetKey allows you to do just
  9. that and a whole lot more.  SetKey is a keymap editor that allows up to eight
  10. strings to be assigned to most keys on the keyboard.  Also characters can be
  11. entered in HEX so that maximum flexibility is maintained.  The SetKey keymap
  12. editor is easy to use, easy to learn and best of all compatible with SetMap.
  13.  
  14.    SetKey can be used from WorkBench or the CLI.  If SetKey is run from the
  15. CLI, a keymap that is stored in DEVS:keymaps/ can be used as an argument.  If
  16. no keymap is specified then the current default keymap is used.  When SetKey
  17. is run, it presents the user with a diagram of the keyboard with all the keys
  18. ready to be edited.  Using SetKey starts with selecting a qualifier, if any,
  19. then a key to edit.
  20.  
  21.   For anyone unfamiliar with the concept of qualifiers, there are three
  22. qualifiers on the Amiga keyboard, shift, alt, and control.  Any time that you
  23. hold one of the qualifier keys and press another key, the code which is sent
  24. to the computer includes the qualifier.  This code is then translated by
  25. looking up (in the keymap!) the code and qualifier, and the translated code
  26. is finally sent to the application as a character or a string of characters. 
  27. Since there is no restriction placed on the characters in the keymap, keys
  28. may "map" to strings containing carriage returns or other control codes, so
  29. that a single keypress can be made to perform several commands.  In addition,
  30. qualifiers may be combined (e.g. shift+alt or shift+alt+control) making a
  31. total of eight different strings for each key.  SetKey supports the mapping
  32. of all eight combinations with either characters or strings.  Now that we
  33. have explained what SetKey does, lets examine how it works.
  34.  
  35.    To get familiar with SetKey, run the program from either CLI or WorkBench.
  36. First press the letter "a".  Notice the a key on the keyboard picture is
  37. highlighted, and a box appears at the bottom of the screen with quite a bit
  38. of information in it.  At the top of this box are three fields, indicating
  39. the key selected, its internal code value in hexidecimal, and any qualifiers
  40. currently selected.  Note that the current display shows "none" for the
  41. qualifiers, since we did not press any qualifier keys before we pressed the
  42. "a" key.  To indicate a qualifier, simply press the desired qualifier(s)
  43. BEFORE selecting the key you intend to edit.  This action will highlight the
  44. qualifier(s) you select, and when you subsequently press a key to edit, you
  45. will see the qualifiers in the third field of the first line in the box.  In
  46. the center of the box is a long string gadget containing the letter "a". 
  47. There is a short string gadget in the bottom left corner, used for entering
  48. characters in hex.  There are two more gadgets in the box, the "Modify
  49. Keymap" gadget and the "Cancel" gadget.  Use the mouse to point at the Cancel
  50. gadget and press the select mouse button.  The box will disappear and the a
  51. key will return to normal on the display.  Now lets actually map a string to
  52. the shifted f1 key and test it in the CLI.
  53.  
  54.    First press any shift key on the keyboard (you may point at the keys in
  55. the display and press the select button on the mouse if you prefer).  All the
  56. shift keys on the keyboard should be highlighted.  Now press the f1 key (or
  57. point and click).  The box will reappear at the bottom of the display with 4
  58. characters in the long string gadget in the center of the box.  The 4
  59. characters should be an escape character (which Intuition displays in string
  60. gadgets as a tall box shaped character) then "10~".  We are going to replace
  61. this relatively useless string with one that actually does something.  First
  62. click in the long string gadget to activate it.  The cursor will be displayed
  63. inside the gadget.  Delete all the characters in the box and then type  "cd
  64. df0:" without the quotation marks.  Now we would like to set up our new
  65. shifted f1 to perform the cd df0: without having to press return after we
  66. press shift f1.  To do this, we need to include the "return" at the end of
  67. our string.  But pressing return now causes the display to blink and include
  68. a return in the string with the cursor placed one character to the right
  69. ready for more input.
  70.  
  71.   The hex entry gadget allows you to type in a hex number, which is
  72. translated into a character and placed in the string at the current cursor
  73. position, replacing whatever was previously there.  Start by getting the
  74. cursor to the end of the long string gadget.  Now point at the hex gadget and
  75. press the select button.  The value displayed to the right of the hex gadget
  76. should change to 00.  This is the value in hex of the character at the end of
  77. the string in the long string gadget.  Type whatever HEX value you want, if
  78. any, at the current cursor location and hit return.  Then click back on the
  79. string input gadget to continue input.  Notice that a tall box appears at the
  80. end of the long string gadget.  SetKey has replaced the 00 with the HEX value
  81. you have entered.  Now that we have finished modifying the key, let's store 
  82. it in the temporary working keymap by clicking on the Modify Keymap gadget.
  83.  
  84.   You may repeat this process for other keys on the display until you have
  85. the keys "mapped" according to your own preferences.  The new keymap may now
  86. be saved by pulling down the Main Control menu and selecting "Save a keymap
  87. to the disk".  When you do this, another box will be displayed with a
  88. directory string gadget and a filename string gadget in it.  The directory
  89. string gadget points to DEVS:keymaps by default.  This is the directory that
  90. setmap will look in later when we activate our keymap, so it is best to put
  91. all of your new keymaps here.  Type in "example" in the filename gadget and
  92. click on the Save gadget.  If your DEVS:keymaps disk has room and isn't write
  93. protected, the file will be stored.  To exit, you may either click on the
  94. closewindow gadget or use one of the exit options from the main menu.  Now
  95. we're ready to activate the new keymap.  From the CLI, enter "setmap
  96. example".  Your keymap has now been activated.  To see it work, hold shift
  97. and press f1.  The CLI should do cd df0: for you.  Try out any other keys you
  98. have mapped.  That's all there is to it.  You are free to make further
  99. modifications by using SetKey again, but be aware that setmap will not
  100. replace a keymap which has already been activated.  If you make changes with
  101. SetKey and store under the same name, setmap will simply reactivate your
  102. first version of the keymap.  The only way to activate a new version with the
  103. same name is to reboot the Amiga and then do setmap again.
  104.