diff --git a/UPDATING b/UPDATING --- a/UPDATING +++ b/UPDATING @@ -26,7 +26,11 @@ debugging, define WITH_MALLOC_PRODUCTION in /etc/src.conf and rebuild world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) - + +20230221: + Introduce new kernel options KBD_DELAY1 and KBD_DELAY2. See atkbdc(4) + for details. + 20230206: sshd now defaults to having X11Forwarding disabled, following upstream. Administrators who wish to enable X11Forwarding should add diff --git a/share/man/man4/atkbdc.4 b/share/man/man4/atkbdc.4 --- a/share/man/man4/atkbdc.4 +++ b/share/man/man4/atkbdc.4 @@ -90,6 +90,12 @@ and 5 for .Fa Y . +.It Em KBD_DELAY1=X, KBD_DELAY2=Y +DELAY1 sets the intitial key repeat delay to +.Fa X . +The default value is 500ms. DELAY2 sets the key repeat delay to +.Fa Y . +The default value is 200ms. .It Em KBDIO_DEBUG=N Sets the debug level to .Fa N . diff --git a/share/man/man4/ukbd.4 b/share/man/man4/ukbd.4 --- a/share/man/man4/ukbd.4 +++ b/share/man/man4/ukbd.4 @@ -136,6 +136,15 @@ .D1 Cd "options KBD_DISABLE_KEYMAP_LOADING" .Pp Do not allow the user to change the keymap. +.Pp +.D1 Cd "options KBD_DELAY1=200" +.Pp +Set the keyboard initial key repeat delay. +.Pp +.D1 Cd "options KBD_DELAY2=15" +.Pp +Set the keyboard key repeat delay. +.Pp Note that these options also affect the AT keyboard driver, .Xr atkbd 4 . .Sh SYSCTL VARIABLES diff --git a/sys/conf/NOTES b/sys/conf/NOTES --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -1493,7 +1493,11 @@ # These options are valid for other keyboard drivers as well. options KBD_DISABLE_KEYMAP_LOAD # refuse to load a keymap -options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options KBD_INSTALL_CDEV # install a CDEV entry in /dev + +# Define keyboard latency (try 200/15 for a snappy interactive console) +options KBD_DELAY1=500 # define initial key delay +options KBD_DELAY2=100 # define key delay device kbdmux # keyboard multiplexer options KBDMUX_DFLT_KEYMAP # specify the built-in keymap diff --git a/sys/conf/options b/sys/conf/options --- a/sys/conf/options +++ b/sys/conf/options @@ -803,8 +803,9 @@ KBD_MAXRETRY opt_kbd.h KBD_MAXWAIT opt_kbd.h KBD_RESETDELAY opt_kbd.h +KBD_DELAY1 opt_kbd.h +KBD_DELAY2 opt_kbd.h KBDIO_DEBUG opt_kbd.h - KBDMUX_DFLT_KEYMAP opt_kbdmux.h # options for the Atheros driver diff --git a/sys/dev/kbd/kbd.c b/sys/dev/kbd/kbd.c --- a/sys/dev/kbd/kbd.c +++ b/sys/dev/kbd/kbd.c @@ -143,8 +143,8 @@ kbd->kb_accentmap = NULL; kbd->kb_fkeytab = NULL; kbd->kb_fkeytab_size = 0; - kbd->kb_delay1 = KB_DELAY1; /* these values are advisory only */ - kbd->kb_delay2 = KB_DELAY2; + kbd->kb_delay1 = KBD_DELAY1; /* these values are advisory only */ + kbd->kb_delay2 = KBD_DELAY2; kbd->kb_count = 0L; bzero(kbd->kb_lastact, sizeof(kbd->kb_lastact)); } diff --git a/sys/dev/kbd/kbdreg.h b/sys/dev/kbd/kbdreg.h --- a/sys/dev/kbd/kbdreg.h +++ b/sys/dev/kbd/kbdreg.h @@ -151,8 +151,12 @@ void *kb_data; /* the driver's private data */ int kb_delay1; int kb_delay2; -#define KB_DELAY1 500 -#define KB_DELAY2 100 +#ifndef KBD_DELAY1 +#define KBD_DELAY1 500 +#endif +#ifndef KBD_DELAY2 +#define KBD_DELAY2 100 +#endif unsigned long kb_count; /* # of processed key strokes */ u_char kb_lastact[NUM_KEYS/2]; struct cdev *kb_dev;