home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / sound / digistuf / click / click.doc next >
Text File  |  1992-08-20  |  15KB  |  400 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                  
  11.                  
  12.                             Digital Keyclick
  13.                             
  14.                         Copyright (C) 1991, 1992
  15.                             By David Baggett
  16.  
  17.  
  18. --------------------------------------------------------------------------------
  19.                              User Contract
  20.  
  21. This program is SHAREWARE.  You may distribute it at will, provided you
  22.         
  23.         1) do not charge any money for it,
  24.         2) distribute it WITH the documentation, and
  25.         3) do not change the program or documentation in ANY WAY.
  26.  
  27. The idea here is that you get to TRY before you BUY.  So try, then BUY.
  28.  
  29. --------------------------------------------------------------------------------
  30.  
  31.  
  32. Introduction  
  33. ------------
  34.  
  35.    Are you completely sick of the cheesy ST keyclick?  Do you envy those
  36. Mac users who can make their keyboards sound like 1929 manual typewriters?  
  37. Well, wait no longer!  This program will let you install a different 
  38. digital sound for every key on the keyboard!  Are we having fun yet?!
  39.  
  40.    Digital Keyclick now supports the STe's (and TT's, and Falcon's) DMA
  41. sound capabilities.  So you can even have stereo keyclicks -- how 
  42. gratuitous can you get?
  43.  
  44.  
  45. General Usage
  46. -------------
  47.  
  48.    Put click.prg in your AUTO folder.  Then create a file called click.inf
  49. with a standard ASCII text editor and put it in the root directory of
  50. your boot partition (e.g., if your AUTO folder is C:\AUTO\, put click.inf
  51. in C:\).
  52.  
  53. In click.inf you specify which sounds will be mapped to which keys.  Each 
  54. entry in click.inf consists of a sound file name, a playback speed 
  55. (in  Hertz), and a list of the keys that will produce that sound.  Here's 
  56. an example click.inf:
  57.  
  58. {stedma}
  59. [d:\usr\sounds\vowel.snd]       {stereo}    8000    a e i o u 
  60. [d:\usr\sounds\cons.snd]    {stereo}    8000    b c d f g h j k l m n
  61.                             p q r s t v w x y z
  62. [d:\usr\sounds\return.snd]              11000   return
  63.  
  64. Filenames MUST be enclosed in square brackets.  Some white space (spaces,
  65. tabs, newlines) must separate each field, but the amount of white space
  66. is unimportant. Key names (the letters "a e i o ..." and "b c d ..." above) 
  67. must be separated by some white space as well.  In other words,
  68.  
  69. [d:\usr\sounds\vowel.snd]       8000    aeiou
  70.  
  71. is incorrect.
  72.  
  73. Any printable character is a valid key name.  For example,
  74.  
  75. [d:\usr\sounds\special.snd]     8000    ! @ # $ % ^ & * ( )
  76. [d:\usr\sounds\boing.snd]       11000   ~
  77.  
  78. is perfectly acceptable.
  79.  
  80.    If a file name appears twice, the file will be loaded and stored in
  81. memory twice, so always list each file only once.  Instead of writing
  82.  
  83. [d:\usr\sounds\my.snd]          8000    a e i o u
  84. [d:\usr\sounds\my.snd]          8000    y 
  85. [d:\usr\sounds\my.snd]          8000    return
  86.  
  87. write
  88.  
  89. [d:\usr\sounds\my.snd]          8000    a e i o u 
  90.                                         y 
  91.                                         return
  92. or
  93.  
  94. [d:\usr\sounds\my.snd]          8000    a e i o u y return
  95.  
  96. Remember that once you've installed Digital Keyclick, the sound samples 
  97. remain resident in memory until you reboot.
  98.  
  99.  
  100. Other Key Names
  101. ---------------
  102.  
  103.    You may have noticed "return" as a key name in the example above.
  104. Key names are provided for other unprintable characters as well:
  105.  
  106.         backspace       clrhome         delete          esc             
  107.         help            insert          return          space (or spacebar)
  108.         tab             undo
  109.  
  110. are all valid key names and can be used just like printable characters.
  111.  
  112.  
  113. Wildcards
  114. ---------
  115.  
  116.    Several wildcards are provided for mapping large groups of keys.  These
  117. can also be used like printable characters.  They include
  118.  
  119.         all             arrows          funkeys         letters         
  120.         lower           numbers         upper
  121.         
  122. where "arrows" refers to the four cursor keys, "funkeys" refers to function
  123. keys F1 through F10, "letters" refers to upper and lower case letters A
  124. through Z, "lower" refers to lower case letters a through z, "numbers" refers
  125. to the numbers 0 through 9 (on the keypad as well), and "upper" refers  to 
  126. upper case letters A through Z.  "all" maps all keys on the keyboard.
  127.  
  128.    It is important to realize that keys are mapped in the order the names
  129. appear, so you generally want to put wildcards first.  For example,
  130.  
  131. [d:\usr\sounds\nifty.snd]       11000   numbers
  132. [d:\usr\sounds\boring.snd]      11000   all
  133.  
  134. will cause all keys, including the number keys, to get mapped to the 
  135. second sound, since the "all" wildcard will override the effect of the
  136. "numbers" entry.
  137.  
  138.  
  139. ASCII and Scan Codes
  140. --------------------
  141.  
  142.    Each key on the keyboard generates an ASCII code and a scan code
  143. when pressed.  For example, the C key generates the ASCII value 67 and
  144. a scan code of 46.  ASCII values are the same on all machines (so the
  145. C key generates an ASCII code of 67 on a Mac, Amiga, Sun 3/60, etc.) but
  146. scan codes are specific to the Atari ST keyboard.  Special keys, for
  147. example function keys, generate an ASCII code of zero. This means that you 
  148. can only refer to these keys in terms of scan codes.
  149.  
  150.    Digital Keyclick lets you name a key on the keyboard by either ASCII
  151. or scan code.  To name a key by ASCII code, use the decimal ASCII value
  152. follwed by an "A" (with no white space intervening):
  153.  
  154. [d:\usr\sounds\controlc.snd]    11000   3A
  155.  
  156. refers to the Control-C combination, which has ASCII code 3.
  157.  
  158.    Naming keys by scan code is similar -- just use "S" instead of "A":
  159.  
  160. [d:\usr\sounds\alt_q.snd]       11000   16Q
  161.  
  162. refers to the Alt-Q combination, which has ASCII code zero, scan code 16.
  163.  
  164.    Note that only special keys that generate ASCII codes of 0 can be
  165. named this way.  If a key generates a nonzero ASCII value, that value will 
  166. be used instead of the scan code.  So it's not possible to distinguish,
  167. for example, between the Return key and the Enter key (on the keypad), since 
  168. both of these keys generate an ASCII code of 13.
  169.  
  170.    The wildcard "scan" refers to all keys that generate an ASCII code of
  171. zero.  Similarly, the wildcard "ascii" refers to all keys that generate
  172. a nonzero ASCII code.
  173.  
  174.    A table of ASCII and scan codes is included at the end of this
  175. document.
  176.  
  177.  
  178. Making Keys Silent
  179. ------------------
  180.  
  181.    You may want to "unmap" a key previously named with a wildcard to make 
  182. it silent.  To do this, use two square brackets with no white space between 
  183. them as the filename, and omit the playback speed.  Writing
  184.  
  185. [d:\usr\sounds\loud.snd]        11000           all
  186. []                                              7A esc
  187.  
  188. will prevent Digitial Keyclick from playing a sound when either Control-G 
  189. or Esc are pressed.
  190.  
  191.  
  192. Enabling and Disabling Digital Keyclick
  193. ---------------------------------------
  194.  
  195.    When click.prg is invoked with no parameters, it reads the click.inf
  196. file and loads all the sounds.  This typically occurs at bootup in the
  197. AUTO folder.  However, you can run click.prg from a command shell (or
  198. from the desktop if you rename a copy click.ttp) as well.  To turn
  199. Digital Keyclick off, type
  200.  
  201.         click off
  202.  
  203. from a command shell, or run click.ttp from the desktop with parameter
  204. "off".
  205.  
  206.    Similary, type
  207.  
  208.         click on
  209.  
  210. to turn Digital Keyclick back on.
  211.  
  212.  
  213. Specifying an Alternate D/A Device
  214. ----------------------------------
  215.  
  216.    Digital Keyclick can be configured to play its samples through 
  217. other D/A devices.  Currently, the Hippo/Navarone and ST Replay digitizers
  218. are supported.  The STe's (and TT's, and Falcon's) 8-bit D/A is also
  219. supported, with either the DMA or the MFP for timing.  (If you use the
  220. DMA for timing, you can only play at certain sample rates, so sounds may
  221. sound too fast or slow.  On the other hand, if you use the MFP for timing
  222. you can play stereo samples at any rate but the sound quality isn't quite
  223. as good.)
  224.  
  225. Other digitizers will be supported if people send me info on them.
  226.  
  227.    To use an alternate D/A device, put one of the following keywords 
  228. in curly brackets somewhere in your click.inf file:
  229.  
  230.     hippo    replay    dma    mfp
  231.  
  232. For example, a click.inf containing
  233.  
  234. {dma}
  235. [d:\usr\sounds\type2.snd]    8000    all
  236.  
  237. will cause Digital Keyclick to play typewriter sounds through the
  238. DMA sound device, using the DMA for timing.  (This won't work on machines
  239. that don't have DMA sound capabilities, of course.)
  240.  
  241.    Note that the normal ST keyclick will still be masked, even if
  242. you don't use the speaker as the D/A device.  
  243.  
  244.  
  245. Different Kinds of Samples
  246. --------------------------
  247.  
  248.    Unless you tell it otherwise, Digital Keyclick assumes your sounds
  249. are unsigned 8-bit mono samples.  You can use stereo and/or unsigned
  250. samples with Digital Keyclick too, by putting one of the following
  251. keywords in brackets after the filename:
  252.  
  253.     stereo    signed
  254.  
  255. For example, a click.inf containing
  256.  
  257. [d:\usr\sounds\type2.snd]    {stereo}    8000    all
  258.  
  259. will make Digital Keyclick interpret type2.snd as stero data instead
  260. of mono.  (Stereo sounds will play on mono devices; the channels are
  261. just mixed together.)
  262.  
  263. Similarly the line
  264.  
  265. [d:\usr\sounds\type2.snd]    {signed}    8000    all
  266.  
  267. tells Digital Keyclick that type2.snd has signed 8-bit samples instead
  268. of unsigned samples.  Some digitizing software saves sounds in this
  269. format instead of the usual unsigned format.  If you're not sure what
  270. you've got, a general rule of thumb is that if a sound sounds very noisy
  271. you should try it as signed.
  272.  
  273.  
  274. Technical Information
  275. ---------------------
  276.  
  277.    Digital Keyclick steals the Bios trap #13 vector and looks at
  278. the return values from all Bconin(2) calls.  This means that it will
  279. work with all applications that call Bconin(2) (at some level) to
  280. get keypresses.  Some applications remap certain keys; this will
  281. obviously change the way keys are mapped to sounds but will otherwise
  282. not cause Digital Keyclick any problems.
  283.  
  284.    The program uses about 28K when resident, not including the space
  285. taken up by the sample data.  (Down from 38K in version 1.0)
  286.  
  287.    In earlier versions, Digital Keyclick used the high bit of the CONTERM
  288. global to enable and disable itself.  Unfortunately, this conflicted with
  289. at least one person's hard disk driver.  (Don't ask me why.)
  290.  
  291.    This version uses the high bit of memory location 768, chosen arbitrarily 
  292. from the list of user interrupt vectors.  If for some reason Digital Keyclick 
  293. will not run with a particular application resident, try moving the keyclick 
  294. flag somewhere else in memory.  To do this, put the desired flag address in
  295. angle brackets somewhere in your click.inf file; e.g.,
  296.  
  297. <1020>
  298. [d:\usr\sounds\type1.snd]    8000    all
  299.  
  300. will cause Digital Keyclick to use 1020 (decimal) as the memory location 
  301. for the click on/off flag.  To then enable and disable Digital Keyclick,
  302. pass the address as a third parameter to the click [on | off] call; e.g.,
  303.  
  304.     click off 1020
  305.  
  306. will mask bit 7 of the byte at location 1020 decimal, thereby disabling
  307. Digital Keyclick.
  308.  
  309. Memory locations 512 through 1020 are good candidates for flag locations
  310. since they are currently not claimed by Atari.
  311.  
  312. Whenever Digital Keyclick is on it masks the normal system keyclick by 
  313. clearing the appropriate bit in CONTERM.
  314.  
  315.    Digital Keyclick is well-behaved and should work with all versions
  316. of TOS.  It does not use any undocumented techniques or memory locations,
  317. except of course for the keyclick flag itself, which can be moved elsewhere
  318. in memory if necessary.
  319.  
  320.  
  321. Caveats
  322. -------
  323.    
  324.    Some programs do different things to read special keys.  The wildcards 
  325. "arrows" and "funkeys" may not work with some applications for this reason.  
  326. (One such program is GULAM.)
  327.  
  328.    The program will not know it has already been installed if you
  329. run it twice (or ten times) in a row.  Doing so will use up more and
  330. more memory.
  331.  
  332.    Using playback speeds faster than about 16 kHz with MFP timing may
  333. cause problems.  At very fast rates, the machine can do very little but
  334. send samples out the speaker, so keyboard interrupts may get lost.  The net
  335. result is that you'll press a key and the "release" event will get lost; i.e.,
  336. you'll get infinite key repeat.  I find that mashing down lots of keys
  337. fixes this, but it's really easier to use 11 kHz and 8 kHz samples...
  338.  
  339.  
  340. Do You Like This Program?
  341. -------------------------
  342.  
  343.    If you do, please become a registered owner.  Send a MERE $15 to me and
  344. you'll not only be encouraging me to write more nifty utilities, but
  345. also get a FREE disk with TONS OF SAMPLES for use with Digital Keyclick,
  346. PLUS other neat public domain software.  Remember to include your
  347. address so I know where to mail the disk.  Mail to:
  348.  
  349.         Dave Baggett
  350.         5640 Vantage Point Road
  351.         Columbia, MD 21044  USA
  352.  
  353. Thanks!
  354.  
  355.  
  356. Table of ASCII and Scan Codes
  357. -----------------------------
  358.  
  359.    Here are ASCII and scan codes for various keys, in decimal:
  360.  
  361.  
  362. ASCII  Key         ASCII  Key         ASCII  Key         ASCII  Key
  363.   
  364.   1    Control-A     2    Control-B     3    Control-C     4    Control-D
  365.   5    Control-E     6    Control-F     7    Control-G     8    Control-H
  366.   9    Control-I     10   Control-J     11   Control-K     12   Control-L
  367.   13   Control-M     14   Control-N     15   Control-O     16   Control-P
  368.   17   Control-Q     18   Control-R     19   Control-S     20   Control-T
  369.   21   Control-U     22   Control-V     23   Control-W     24   Control-X
  370.   25   Control-Y     26   Control-Z     27   Control-[     28   Control-\
  371.   29   Control-]     30   Control-6     31   Control--     32   Space Bar
  372.  
  373.  
  374. SCAN   Key         SCAN   Key         SCAN   Key         SCAN   Key
  375.  
  376.  16   Alt-Q         17   Alt-W         18   Alt-E         19   Alt-R
  377.  20   Alt-T         21   Alt-Y         22   Alt-U         23   Alt-I
  378.  24   Alt-O         25   Alt-P         
  379.  
  380.  30   Alt-A         31   Alt-S         32   Alt-D         33   Alt-F
  381.  34   Alt-G         35   Alt-H         36   Alt-J         37   Alt-K
  382.  38   Alt-L
  383.  
  384.  44   Alt-Z         45   Alt-X         46   Alt-C         47   Alt-V
  385.  48   Alt-B         49   Alt-N         50   Alt-M         
  386.  
  387.  59   F1            60   F2            61   F3            62   F4         
  388.  63   F5            64   F6            65   F7            66   F8
  389.  67   F9            68   F10
  390.  
  391.  71   Home          72   Up Arrow      75   Left Arrow    77   Right Arrow   
  392.  80   Down Arrow    82   Insert        83   Delete
  393.  
  394. 114   Control-Help  115   Control- <-  116   Control- -> 119   Control-Home
  395.  
  396. 120   Alt-1         121   Alt-2        122   Alt-3       123   Alt-4
  397. 124   Alt-5         125   Alt-6        126   Alt-7       127   Alt-8
  398. 128   Alt-9         129   Alt-0        130   Alt--       131   Alt-=
  399.  
  400.