summaryrefslogtreecommitdiff
path: root/sys/dev/sun
diff options
context:
space:
mode:
authorAlexandr Shadchin <shadchin@cvs.openbsd.org>2011-11-09 14:22:39 +0000
committerAlexandr Shadchin <shadchin@cvs.openbsd.org>2011-11-09 14:22:39 +0000
commit33290b80f9f3bf4efe2940d17cb9dd063980baf1 (patch)
treed70ddb271e0a8b5565de32fb4cf1b1548be0694e /sys/dev/sun
parent37ea1385a43c05996bb9f7c01a1bbdf10d1a3ee0 (diff)
Auto-repeat keys in WSKBD_RAW mode is not needed.
WSKBD_RAW mode used in X, but X independently implements auto-repeat keys. ok miod@
Diffstat (limited to 'sys/dev/sun')
-rw-r--r--sys/dev/sun/sunkbd.c36
-rw-r--r--sys/dev/sun/sunkbdvar.h7
2 files changed, 3 insertions, 40 deletions
diff --git a/sys/dev/sun/sunkbd.c b/sys/dev/sun/sunkbd.c
index a15bde3aede..fa501110842 100644
--- a/sys/dev/sun/sunkbd.c
+++ b/sys/dev/sun/sunkbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sunkbd.c,v 1.25 2009/01/12 21:11:58 miod Exp $ */
+/* $OpenBSD: sunkbd.c,v 1.26 2011/11/09 14:22:37 shadchin Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -61,7 +61,6 @@ void sunkbd_decode5(u_int8_t, u_int *, int *);
int sunkbd_enable(void *, int);
int sunkbd_getleds(struct sunkbd_softc *);
int sunkbd_ioctl(void *, u_long, caddr_t, int, struct proc *);
-void sunkbd_rawrepeat(void *);
void sunkbd_setleds(void *, int);
struct wskbd_accessops sunkbd_accessops = {
@@ -73,10 +72,6 @@ struct wskbd_accessops sunkbd_accessops = {
void
sunkbd_attach(struct sunkbd_softc *sc, struct wskbddev_attach_args *waa)
{
-#ifdef WSDISPLAY_COMPAT_RAWKBD
- timeout_set(&sc->sc_rawrepeat_tmo, sunkbd_rawrepeat, sc);
-#endif
-
if (ISTYPE5(sc->sc_layout))
sc->sc_decode = sunkbd_decode5;
else
@@ -189,11 +184,8 @@ sunkbd_input(struct sunkbd_softc *sc, u_int8_t *buf, u_int buflen)
#ifdef WSDISPLAY_COMPAT_RAWKBD
if (sc->sc_rawkbd) {
u_char rbuf[SUNKBD_MAX_INPUT_SIZE * 2];
- int c, rlen, npress;
-
- timeout_del(&sc->sc_rawrepeat_tmo);
+ int c, rlen = 0;
- npress = rlen = 0;
while (buflen-- != 0) {
(*sc->sc_decode)(*buf++, &type, &value);
c = sunkbd_rawmap[value];
@@ -205,21 +197,12 @@ sunkbd_input(struct sunkbd_softc *sc, u_int8_t *buf, u_int buflen)
rbuf[rlen] = c & 0x7f;
if (type == WSCONS_EVENT_KEY_UP)
rbuf[rlen] |= 0x80;
- else {
- /* remember down keys for autorepeat */
- if (c & 0x80)
- sc->sc_rep[npress++] = 0xe0;
- sc->sc_rep[npress++] = c & 0x7f;
- }
rlen++;
}
s = spltty();
wskbd_rawinput(sc->sc_wskbddev, rbuf, rlen);
splx(s);
- sc->sc_nrep = npress;
- if (npress != 0)
- timeout_add_msec(&sc->sc_rawrepeat_tmo, REP_DELAY1);
} else
#endif
{
@@ -259,7 +242,6 @@ sunkbd_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p)
#ifdef WSDISPLAY_COMPAT_RAWKBD
case WSKBDIO_SETMODE:
sc->sc_rawkbd = *(int *)data == WSKBD_RAW;
- timeout_del(&sc->sc_rawrepeat_tmo);
return (0);
#endif
}
@@ -309,20 +291,6 @@ sunkbd_raw(struct sunkbd_softc *sc, u_int8_t c)
}
}
-#ifdef WSDISPLAY_COMPAT_RAWKBD
-void
-sunkbd_rawrepeat(void *v)
-{
- struct sunkbd_softc *sc = v;
- int s;
-
- s = spltty();
- wskbd_rawinput(sc->sc_wskbddev, sc->sc_rep, sc->sc_nrep);
- splx(s);
- timeout_add_msec(&sc->sc_rawrepeat_tmo, REP_DELAYN);
-}
-#endif
-
int
sunkbd_setclick(struct sunkbd_softc *sc, int click)
{
diff --git a/sys/dev/sun/sunkbdvar.h b/sys/dev/sun/sunkbdvar.h
index 656fe3c7116..beae21737b7 100644
--- a/sys/dev/sun/sunkbdvar.h
+++ b/sys/dev/sun/sunkbdvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sunkbdvar.h,v 1.15 2009/01/12 21:11:58 miod Exp $ */
+/* $OpenBSD: sunkbdvar.h,v 1.16 2011/11/09 14:22:38 shadchin Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -52,11 +52,6 @@ struct sunkbd_softc {
#ifdef WSDISPLAY_COMPAT_RAWKBD
int sc_rawkbd;
- int sc_nrep;
- char sc_rep[SUNKBD_MAX_INPUT_SIZE * 2];
- struct timeout sc_rawrepeat_tmo;
-#define REP_DELAY1 400
-#define REP_DELAYN 100
#endif
};