home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / commodities / yak / englishdocs / hotkeys.doc next >
Text File  |  1993-01-07  |  5KB  |  202 lines

  1. This information is adapted from the ToolManager V2 documentation, and
  2. is reproduced with kind permission of that program's author, Stefan
  3. Becker.
  4.  
  5. How to define a Hot Key
  6. ************************
  7.  
  8.    This chapter describes how to define a Hot Key as an Input
  9. Description String, which is then parsed by Commodities. Each time a
  10. Hot Key is activated Commodities generates an event which is used by
  11. a Commodity in the chain. A description string has the following
  12. syntax:
  13.  
  14.      [<class>] {[-][<qualifier>]} [-][upstroke] [<key code>]
  15.  
  16.    All keywords are case insensitive.
  17.  
  18.    `class' describes the InputEvent class. This parameter is optional
  19. and if it is missing the default `rawkey' is used. See InputEvent
  20. classes.
  21.  
  22.    Qualifiers are "signals" that must be set or cleared by the time the
  23. Hot Key is activated; otherwise no event will be generated. For each
  24. qualifier that must be set you supply its keyword. All other qualifiers
  25. are expected to be cleared by default. If you want to ignore a
  26. qualifier, just set a `-' before its keyword. See Qualifiers.
  27.  
  28.    Normally a Hot Key event is generated when a key is pressed. If the
  29. event should be generated when the key is released, supply the keyword
  30. `upstroke'. When both press and release of the key should generate an
  31. event, use `-upstroke'.
  32.  
  33.    The key code is depending on the InputEvent class. See Key codes.
  34.  
  35.    Note: Choose your hot keys *carefully*, because Commodities has a
  36. high priority in the InputEvent handler chain (i.e. will override
  37. existing definitions).
  38.  
  39.  
  40. InputEvent classes
  41. ===================
  42.  
  43.    Commodities supports most of the InputEvent classes that are
  44. generated by the input.device. This section describes those classes
  45. that are most useful for Hot Keys.
  46.  
  47. `rawkey'
  48.      This is the default class and covers all keyboard events. For
  49.      example `rawkey a' or `a' creates an event every time when the key
  50.      "a" is pressed. You must specify a key code for this class. See
  51.      rawkey key codes.
  52.  
  53. `rawmouse'
  54.      This class describes all mouse button events. You must specify a
  55.      key code for this class. See rawmouse key codes.
  56.  
  57. `diskinserted'
  58.      Events of this class are generated when a disk is inserted in a
  59.      drive. This class has no key codes.
  60.  
  61. `diskremoved'
  62.      Events of this class are generated when a disk is removed from a
  63.      drive. This class has no key codes.
  64.  
  65.  
  66. Qualifiers
  67. ===========
  68.  
  69.    Some keyword synonyms were added to Commodities V38. These are
  70. marked with an `*'.
  71.  
  72. `lshift', `left_shift' *
  73.      Left shift key.
  74.  
  75. `rshift', `right_shift' *
  76.      Right shift key.
  77.  
  78. `shift'
  79.      Either shift key.
  80.  
  81. `capslock', `caps_lock' *
  82.      Caps lock key.
  83.  
  84. `caps'
  85.      Either shift key or caps lock key.
  86.  
  87. `control', `ctrl' *
  88.      Control key.
  89.  
  90. `lalt', `left_alt' *
  91.      Left alt key.
  92.  
  93. `ralt', `right_alt' *
  94.      Right alt key.
  95.  
  96. `alt'
  97.      Either alt key.
  98.  
  99. `lcommand', `lamiga' *, `left_amiga' *, `left_command' *
  100.      Left Amiga/Command key.
  101.  
  102. `rcommand', `ramiga' *, `right_amiga' *, `right_command' *
  103.      Right Amiga/Command key.
  104.  
  105. `numericpad', `numpad' *, `num_pad' *, `numeric_pad' *
  106.      This keyword *must* be used for any key on the numeric pad.
  107.  
  108. `leftbutton', `lbutton' *, `left_button' *
  109.      Left mouse button. See note below.
  110.  
  111. `midbutton', `mbutton' *, `middlebutton' *, `middle_button' *
  112.      Middle mouse button. See note below.
  113.  
  114. `rbutton', `rightbutton' *, `right_button' *
  115.      Right mouse button. See note below.
  116.  
  117. `repeat'
  118.      This qualifier is set when the keyboard repeat is active. Only
  119.      useful for InputEvent class `rawkey'.
  120.  
  121.    Note: Commodities V37 has a bug which prevents the use of
  122. `leftbutton', `midbutton' and `rbutton' as qualifiers. This bug is
  123. fixed in V38.
  124.  
  125.  
  126. Key codes
  127. ==========
  128.  
  129.    Each InputEvent class has its own key codes:
  130.  
  131.  
  132. Key codes for InputEvent class `rawkey'
  133. ----------------------------------------
  134.  
  135.    Some keywords and synonyms were added to Commodities V38. These are
  136. marked with an `*'.
  137.  
  138. `a'-`z', `0'-`9', ...
  139.      ASCII characters.
  140.  
  141. `f1', `f2', ..., `f10', `f11' *, `f12' *
  142.      Function keys.
  143.  
  144. `up', `cursor_up' *, `down', `cursor_down' *
  145. `left', `cursor_left' *, `right', `cursor_right' *
  146.      Cursor keys.
  147.  
  148. `esc', `escape' *, `backspace', `del', `help'
  149. `tab', `comma', `return', `space', `spacebar' *
  150.      Special keys.
  151.  
  152. `enter', `insert' *, `delete' *
  153. `page_up' *, `page_down' *, `home' *, `end' *
  154.      Numeric Pad keys. Each of these key codes *must* be used with the
  155.      `numericpad' qualifier keyword!
  156.  
  157.  
  158. Key codes for InputEvent class `rawmouse'
  159. ------------------------------------------
  160.  
  161.    These keywords were added to Commodities V38. They are not available
  162. in V37.
  163.  
  164. `mouse_leftpress'
  165.      Press left mouse button.
  166.  
  167. `mouse_middlepress'
  168.      Press middle mouse button.
  169.  
  170. `mouse_rightpress'
  171.      Press right mouse button.
  172.  
  173.    Note: To use one of these key codes, you must also set the
  174. corresponding qualifier keyword, e.g.
  175.  
  176.      rawmouse leftbutton mouse_leftpress
  177.  
  178.  
  179. Examples for Hot Keys
  180. ======================
  181.  
  182. `ralt t'
  183.      Hold right Alt key and press "t"
  184.  
  185. `ralt lalt t'
  186.      Hold left *and* right Alt key and press "t"
  187.  
  188. `alt t'
  189.      Hold either Alt key and press "t"
  190.  
  191. `rcommand f2'
  192.      Hold right Amiga key and press the second function key
  193.  
  194. `numericpad enter'
  195.      Press the Enter key on the numeric pad
  196.  
  197. `rawmouse midbutton leftbutton mouse_leftpress'
  198.      Hold middle mouse button and press the the left mouse button
  199.  
  200. `diskinserted'
  201.      Insert a disk in any drive.
  202.