Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/hp300/dev In RAWKBD mode, don't schedule autorepeat...



details:   https://anonhg.NetBSD.org/src/rev/452fe6b4a8b9
branches:  trunk
changeset: 822575:452fe6b4a8b9
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Mar 25 22:08:27 2017 +0000

description:
In RAWKBD mode, don't schedule autorepeat callout(9) after KEY_UP events.

Now Apollo Domain keyboard works propery on Xorg server on my 425t.
Changes are taken from sys/dev/hil/hilkbd.c.

Note as OpenBSD says in the following commit log:
 http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/arch/hp300/dev/Attic/dnkbd.c#rev1.18
>> Auto-repeat keys in WSKBD_RAW mode is not needed.
>> WSKBD_RAW mode used in X, but X independently implements auto-repeat keys.
these autorepeat code will be removed later, but I commit this fix first
for the record.

diffstat:

 sys/arch/hp300/dev/dnkbd.c |  17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diffs (46 lines):

diff -r 2f92d85605c4 -r 452fe6b4a8b9 sys/arch/hp300/dev/dnkbd.c
--- a/sys/arch/hp300/dev/dnkbd.c        Sat Mar 25 18:15:31 2017 +0000
+++ b/sys/arch/hp300/dev/dnkbd.c        Sat Mar 25 22:08:27 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dnkbd.c,v 1.8 2017/03/25 01:48:31 tsutsui Exp $        */
+/*     $NetBSD: dnkbd.c,v 1.9 2017/03/25 22:08:27 tsutsui Exp $        */
 /*     $OpenBSD: dnkbd.c,v 1.17 2009/07/23 21:05:56 blambert Exp $     */
 
 /*
@@ -706,8 +706,9 @@
 #ifdef WSDISPLAY_COMPAT_RAWKBD
        if (sc->sc_rawkbd) {
                u_char cbuf[2];
-               int c, j = 0;
+               int c, j, npress;
 
+               npress = j = 0;
                c = dnkbd_raw[key];
                if (c != 0) {
                        /* fake extended scancode if necessary */
@@ -718,7 +719,9 @@
                                cbuf[j] |= 0x80;
                        else {
                                /* remember pressed key for autorepeat */
-                               memcpy(sc->sc_rep, cbuf, sizeof(sc->sc_rep));
+                               if (c & 0x80)
+                                       sc->sc_rep[npress++] = 0xe0;
+                               sc->sc_rep[npress++] = c & 0x7f;
                        }
                        j++;
                }
@@ -728,9 +731,11 @@
                        wskbd_rawinput(sc->sc_wskbddev, cbuf, j);
                        splx(s);
                        callout_stop(&sc->sc_rawrepeat_ch);
-                       sc->sc_nrep = j;
-                       callout_schedule(&sc->sc_rawrepeat_ch,
-                           mstohz(REP_DELAY1));
+                       sc->sc_nrep = npress;
+                       if (npress != 0) {
+                               callout_schedule(&sc->sc_rawrepeat_ch,
+                                   mstohz(REP_DELAY1));
+                       }
                }
        } else
 #endif



Home | Main Index | Thread Index | Old Index