summaryrefslogtreecommitdiff
path: root/sys/dev/adb
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/adb
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/adb')
-rw-r--r--sys/dev/adb/akbd.c39
-rw-r--r--sys/dev/adb/akbdvar.h8
2 files changed, 5 insertions, 42 deletions
diff --git a/sys/dev/adb/akbd.c b/sys/dev/adb/akbd.c
index d48aed97bf3..5f30294eed2 100644
--- a/sys/dev/adb/akbd.c
+++ b/sys/dev/adb/akbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: akbd.c,v 1.10 2011/06/15 21:32:05 miod Exp $ */
+/* $OpenBSD: akbd.c,v 1.11 2011/11/09 14:22:37 shadchin Exp $ */
/* $NetBSD: akbd.c,v 1.17 2005/01/15 16:00:59 chs Exp $ */
/*
@@ -88,7 +88,6 @@ void akbd_adbcomplete(caddr_t, caddr_t, int);
void akbd_capslockwrapper(struct akbd_softc *, int);
void akbd_input(struct akbd_softc *, int);
void akbd_processevent(struct akbd_softc *, adb_event_t *);
-void akbd_rawrepeat(void *v);
#ifdef notyet
u_char getleds(int);
int setleds(struct akbd_softc *, u_char);
@@ -237,10 +236,6 @@ akbdattach(struct device *parent, struct device *self, void *aux)
printf("akbd: returned %d from set_adb_info\n", error);
#endif
-#ifdef WSDISPLAY_COMPAT_RAWKBD
- timeout_set(&sc->sc_rawrepeat_ch, akbd_rawrepeat, sc);
-#endif
-
if (akbd_is_console() && wskbd_eligible)
a.console = (++akbd_console_initted == 1);
else
@@ -420,7 +415,6 @@ akbd_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_ch);
return (0);
#endif
@@ -438,20 +432,6 @@ akbd_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p)
}
}
-#ifdef WSDISPLAY_COMPAT_RAWKBD
-void
-akbd_rawrepeat(void *v)
-{
- struct akbd_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_ch, REP_DELAYN);
-}
-#endif
-
/*
* The ``caps lock'' key is special: since on earlier keyboards, the physical
* key stays down when pressed, we will get a notification of the key press,
@@ -547,11 +527,10 @@ akbd_input(struct akbd_softc *sc, int key)
adb_polledkey = key;
#ifdef WSDISPLAY_COMPAT_RAWKBD
} else if (sc->sc_rawkbd) {
- char cbuf[MAXKEYS *2];
+ char cbuf[2];
int c, j, s;
- int npress;
- j = npress = 0;
+ j = 0;
c = keyboard[val];
if (c == 0) {
@@ -560,22 +539,12 @@ akbd_input(struct akbd_softc *sc, int key)
if (c & 0x80)
cbuf[j++] = 0xe0;
cbuf[j] = c & 0x7f;
- if (type == WSCONS_EVENT_KEY_UP) {
+ if (type == WSCONS_EVENT_KEY_UP)
cbuf[j] |= 0x80;
- } else {
- /* this only records last key pressed */
- if (c & 0x80)
- sc->sc_rep[npress++] = 0xe0;
- sc->sc_rep[npress++] = c & 0x7f;
- }
j++;
s = spltty();
wskbd_rawinput(sc->sc_wskbddev, cbuf, j);
splx(s);
- timeout_del(&sc->sc_rawrepeat_ch);
- sc->sc_nrep = npress;
- if (npress != 0)
- timeout_add_msec(&sc->sc_rawrepeat_ch, REP_DELAY1);
#endif
} else {
wskbd_input(sc->sc_wskbddev, type, val);
diff --git a/sys/dev/adb/akbdvar.h b/sys/dev/adb/akbdvar.h
index 7fefdb98075..81d49f13a88 100644
--- a/sys/dev/adb/akbdvar.h
+++ b/sys/dev/adb/akbdvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: akbdvar.h,v 1.2 2006/03/23 21:54:26 miod Exp $ */
+/* $OpenBSD: akbdvar.h,v 1.3 2011/11/09 14:22:37 shadchin Exp $ */
/* $NetBSD: akbdvar.h,v 1.4 1999/02/17 14:56:56 tsubai Exp $ */
/*
@@ -51,13 +51,7 @@ struct akbd_softc {
struct device *sc_wskbddev;
#ifdef WSDISPLAY_COMPAT_RAWKBD
-#define MAXKEYS 20
-#define REP_DELAY1 400
-#define REP_DELAYN 100
int sc_rawkbd;
- int sc_nrep;
- char sc_rep[MAXKEYS];
- struct timeout sc_rawrepeat_ch;
#endif /* defined(WSDISPLAY_COMPAT_RAWKBD) */
};