home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / TR12OS.ZIP / TYPERATE.DOC next >
Text File  |  1990-03-15  |  4KB  |  125 lines

  1. TYPERATE.DOC - Documentation for TYPERATE 1.0 for OS/2 
  2. ------------------------------------------------------
  3.  
  4. Raymond J. Berra
  5. 410 Wehntalerstr.
  6. CH-8046 Zurich, Switzerland
  7.  
  8. BIXname: rberra
  9.  
  10.  
  11. TYPERATE lets you change the typematic rate (the rate at which characters
  12. are repeated if you keep a key down) and the typematic delay (the time
  13. elapsing between the key press and the start of the repeat sequence) to
  14. your liking. TYPERATE is freeware - you may use it if you respect the
  15. conditions of use outlined below.
  16.  
  17. It is NOT a resident utility, so the only penalties you pay for its use
  18. are 12K of wasted harddisk space and a few seconds for its invocation. A
  19. DOS Version of this program is available by me for free, just contact me
  20. through BIX if you're interested in it.
  21.  
  22.  
  23. Instructions
  24. ------------
  25.  
  26. At the OS/2 prompt, enter TYPERATE followed either by a single parameter
  27. that sets both typematic rate and delay (max, opt, reset) or by two integer
  28. numbers that specify the two values. 
  29.  
  30. Here are a few examples:
  31.  
  32. typerate max           You get approx. 30 repeats per second after a
  33.                        250 ms. delay
  34.  
  35. typerate opt           Same as above, except that the repeat sequence
  36.                        starts after 500 ms. (better for less experienced
  37.                        users)
  38.  
  39. typerate 2 1000        Beeeeeeg fun! Slows your keyboard down to a crawl!
  40.  
  41. typerate reset         Resets to IBM default values (11 characters per 
  42.                        second, 500 ms. repeat delay)
  43.  
  44. typerate help          Displays a help screen
  45.  
  46. The best place to invoke TYPERATE is to start the program in the 
  47. STARTUP.CMD file in the root directory of drive C:. That way, you 
  48. won't have to enter the command manually. The typematic values will be
  49. maintained until you turn off your system or until some other program
  50. messes around with them. 
  51.  
  52. Conditions of use for TYPERATE.EXE:
  53. -----------------------------------
  54.  
  55. You MAY: Use, copy, give away, upload the program and the documentation
  56. FREE and AT YOUR OWN RISK. I don't want money, but I also assume no
  57. reponsibility for the correct functioning of the program or for future
  58. revisions and bug fixes.
  59.  
  60. You MAY NOT: Ask money for this program, trade it against anything with
  61. commercial value, or distribute it as a part of a commercial package without
  62. my prior written permission.
  63.  
  64. If you upload it to BBS's, please distribute the whole archive under the
  65. name 'TR11OS' rather than the individual components.
  66.  
  67. PLEASE report bugs and suggestions back to me. Contact addresses are at
  68. the end of this document.
  69.  
  70. Flames:  
  71. ------- 
  72.  
  73. It is a mistery to me why one cannot change the keyboard repeat
  74. parameters in the OS/2 Control Panel, where they belong in the first
  75. place. I suggest IBM and/or Microsoft have a look at the (modular and
  76. extensible!) Macintosh Control Panel.
  77.  
  78.  
  79. Tech info:
  80. ----------
  81.  
  82. There is no magic behind TYPERATE: Typematic rate and delay can be set
  83. with a single OS/2 DEV-call. Here's the 'heart' of the program (I didn't
  84. bother to include the whole source code because it's really a command
  85. line parser and argument checker built around the following code):
  86.  
  87.  
  88. VOID SetTypematic(USHORT usCheckedRate, USHORT usCheckedDelay)
  89.    {
  90.    HFILE     hFile;
  91.    USHORT    usRet, usAction;
  92.    RATEDELAY ratedelay;
  93.  
  94.    ratedelay.usRate  = usCheckedRate;
  95.    ratedelay.usDelay = usCheckedDelay;
  96.    
  97.    usRet = DosOpen("KBD$", &hFile, &usAction, 0L, 0, FILE_OPEN,
  98.                    OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE, 0L);
  99.  
  100.    if (usRet)
  101.       {
  102.       fprintf(stderr, "Open of KBD device failed: %04X, aborting...\n", 
  103.               usRet);
  104.       exit(1);
  105.       }
  106.  
  107.    usRet = DosDevIOCtl(0L, &ratedelay, KBD_SETTYPAMATICRATE, 
  108.                        IOCTL_KEYBOARD, hFile);
  109.  
  110.    if (usRet)
  111.       {
  112.       fprintf(stderr, "Cannot set typematic parameters: %04X, aborting...\n",
  113.               usRet);
  114.       exit(1);
  115.       }
  116.  
  117.    printf("Typematic rate set to %i chars/sec., typematic delay set to %i ms.\n\r",
  118.            usCheckedRate, usCheckedDelay);
  119.  
  120.    DosClose(hFile);
  121.    }
  122.  
  123.  
  124.  
  125.