SUMMARY:change keyboard repeat delay

From: Ed Arnold (era@ncar.ucar.edu)
Date: Thu Dec 03 1992 - 17:28:45 CST


About a month ago I posted this question in comp.sys.sun.admin:

>Can some kind soul tell me via email if there is a way to change the key repeat
>delay (i.e., the time between when I press a key, and it starts repeating) on
>a sparcstation under sunos 4.1.x? I've tried the 4.1.3 answerbook but came
>up empty-handed.

The answers:

o IF USING X:

  Use the -ar1 and -ar2 switches upon X server invocation; "man Xsun"
  for further info.

o IF USING THE PLAIN SUN CONSOLE:

  Change the keyboard driver's repeat rate and/or repeat delay parms,
  which are the kernel variables "kbd_repeatrate" and "kbd_repeatdelay".
  Repeat rate is the number of clock ticks (1 tick = 1/100 sec on SPARC)
  between repeating characters. Repeat delay is the number of clock
  ticks before a key starts repeating. These variables are changed
  by patching them in /vmunix with adb.

o IF USING OPENWINDOWS:

  It's messy! The following material is taken from the
  comp.windows.open-look FAQ, where /KeyRepeatThresh is the repeat delay,
  and /KeyRepeatTime is the (reciprocal of the) repeat rate.

  .startup.ps

  This is the NeWS user profile file, read by OpenWindows (actually xnews)
  on startup. This is documented in the NeWS programming manual, near the
  back. The most useful thing to put here is PostScript code to change
  the keyboard repeat rate, although you must be very careful, since a
  syntax error in the PostScript means that xnews will either not start up
  at all or will get broken in strange ways. The NeWS manual gives code
  that is both incorrect and insufficient.
  WARNING: things in this file rarely work on both OpenWindows 2 and 3.
  
  Note that the mouse speed is best set in your .xinitrc with xset m; see
  the man page for xset ("man xset", and "xset -help") for more information.
  
  Here's what $HOME/.startup.ps should look like if you want a delay of
  about a third of a second (300000 microseconds), and a repeat rate of
  twenty or so keys per second (30000 microseconds between repeats) for
  OpenWindows 3. You'll have to experiment a bit because the RepeatTime
  is the delay between keys sent, and thus doesn't include the time to
  process each key, which is probably higher on my 4/110 than on your
  SuperSPARC 10/51 GTi injection :-) Again, this is for OpenWindows 3...
  
          % don't want the demos - see p. xxxii of NeWS Toolkit Reference Manual
          % /IncludeDemos? false def
  
          UserProfile begin
              /KeyRepeatThresh 0 300000 timeval storetimeval def
              /KeyRepeatTime 0 30000 timeval storetimeval def
              % Note: 300000 and 30000 differ greatly...
          end
  
  You must also have a .user.ps file in the same directory, like this:
  
          /NeWS 3 0 findpackage beginpackage
          /TNTCore 3 0 findpackage beginpackage
          /TNT 3 0 findpackage beginpackage
  
          ClassRepeatKeys pop % force repeat.ps to autoload
  
          endpackage endpackage endpackage
  
  If you change these parameters, you can test them without restarting the
  OpenWindows server like this:
          $ psh -i .startup.ps
          Welcome to X11/NeWS Version3
          $ psh -i
          Welcome to X11/NeWS Version3
          /classinit ClassRepeatKeys send
          %%% now press control-D
  
  You can also either of these two files (.startup.ps and .user.ps) to make
  the root window be "retained", so that a PostScript drawing on the
  background won't be erased when you move windows:
  
          frambuffer /Retained true put
  
  will do this. Note that this may increase the amount of memory used
  by the NeWS server (xnews) dramatically.

Thanks to the following persons for their assistance:

        arch@gandalf.pei.com (Arch Mott)
        guy@auspex.com (Guy Harris)
        jeff@neon.rain.com (Jeff Beadles)
        halvard@trd.sdata.no (Halvard Halvorsen)
        per@erix.ericsson.se (Per Hedeland)
        Bob Sutterfield <bob@MorningStar.Com>
        guy@auspex.com (Guy Harris)

--
Ed Arnold * NCAR * POB 3000, Boulder, CO 80307-3000 * 303-497-1253(voice)
303-497-{1298,1137}(fax) * internet: era@ncar.ucar.edu * bitnet: era@ncario
compuserve: internet:era@ncar.ucar.edu



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:54 CDT