diff options
author | Alexandr Shadchin <shadchin@cvs.openbsd.org> | 2011-11-09 14:22:39 +0000 |
---|---|---|
committer | Alexandr Shadchin <shadchin@cvs.openbsd.org> | 2011-11-09 14:22:39 +0000 |
commit | 33290b80f9f3bf4efe2940d17cb9dd063980baf1 (patch) | |
tree | d70ddb271e0a8b5565de32fb4cf1b1548be0694e | |
parent | 37ea1385a43c05996bb9f7c01a1bbdf10d1a3ee0 (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@
-rw-r--r-- | sys/arch/hp300/dev/dnkbd.c | 36 | ||||
-rw-r--r-- | sys/arch/zaurus/dev/zaurus_kbd.c | 46 | ||||
-rw-r--r-- | sys/dev/adb/akbd.c | 39 | ||||
-rw-r--r-- | sys/dev/adb/akbdvar.h | 8 | ||||
-rw-r--r-- | sys/dev/hil/hilkbd.c | 41 | ||||
-rw-r--r-- | sys/dev/sun/sunkbd.c | 36 | ||||
-rw-r--r-- | sys/dev/sun/sunkbdvar.h | 7 | ||||
-rw-r--r-- | sys/dev/usb/hidkbd.c | 43 | ||||
-rw-r--r-- | sys/dev/usb/hidkbdsc.h | 7 |
9 files changed, 19 insertions, 244 deletions
diff --git a/sys/arch/hp300/dev/dnkbd.c b/sys/arch/hp300/dev/dnkbd.c index 011bc9ddf46..da91908d625 100644 --- a/sys/arch/hp300/dev/dnkbd.c +++ b/sys/arch/hp300/dev/dnkbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dnkbd.c,v 1.17 2009/07/23 21:05:56 blambert Exp $ */ +/* $OpenBSD: dnkbd.c,v 1.18 2011/11/09 14:22:37 shadchin Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat @@ -150,11 +150,6 @@ struct dnkbd_softc { #ifdef WSDISPLAY_COMPAT_RAWKBD int sc_rawkbd; - int sc_nrep; - char sc_rep[2]; /* at most, one key */ - struct timeout sc_rawrepeat_ch; -#define REP_DELAY1 400 -#define REP_DELAYN 100 #endif }; @@ -224,7 +219,6 @@ int dnkbd_intr(void *); int dnkbd_pollin(struct apciregs *, u_int); int dnkbd_pollout(struct apciregs *, int); int dnkbd_probe(struct dnkbd_softc *); -void dnkbd_rawrepeat(void *); int dnkbd_send(struct apciregs *, const u_int8_t *, size_t); int dnsubmatch_kbd(struct device *, void *, void *); int dnsubmatch_mouse(struct device *, void *, void *); @@ -252,9 +246,6 @@ dnkbd_attach(struct device *parent, struct device *self, void *aux) sc->sc_regs = (struct apciregs *)IIOV(FRODO_BASE + fa->fa_offset); timeout_set(&sc->sc_bellstop_tmo, dnkbd_bellstop, sc); -#ifdef WSDISPLAY_COMPAT_RAWKBD - timeout_set(&sc->sc_rawrepeat_ch, dnkbd_rawrepeat, sc); -#endif /* reset the port */ apciinit(sc->sc_regs, 1200, CFCR_8BITS | CFCR_PEVEN | CFCR_PENAB); @@ -667,20 +658,11 @@ dnevent_kbd_internal(struct dnkbd_softc *sc, int dat) cbuf[j] = c & 0x7f; if (type == WSCONS_EVENT_KEY_UP) cbuf[j] |= 0x80; - else { - /* remember pressed key for autorepeat */ - bcopy(cbuf, sc->sc_rep, sizeof(sc->sc_rep)); - } j++; - } - if (j != 0) { s = spltty(); wskbd_rawinput(sc->sc_wskbddev, cbuf, j); splx(s); - timeout_del(&sc->sc_rawrepeat_ch); - sc->sc_nrep = j; - timeout_add_msec(&sc->sc_rawrepeat_ch, REP_DELAY1); } } else #endif @@ -691,21 +673,6 @@ dnevent_kbd_internal(struct dnkbd_softc *sc, int dat) } } -#ifdef WSDISPLAY_COMPAT_RAWKBD -void -dnkbd_rawrepeat(void *v) -{ - struct dnkbd_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 - #if NWSMOUSE > 0 void dnevent_mouse(struct dnkbd_softc *sc, u_int8_t *dat) @@ -950,7 +917,6 @@ dnkbd_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 } diff --git a/sys/arch/zaurus/dev/zaurus_kbd.c b/sys/arch/zaurus/dev/zaurus_kbd.c index da14d54e3b9..ea8cc1a704c 100644 --- a/sys/arch/zaurus/dev/zaurus_kbd.c +++ b/sys/arch/zaurus/dev/zaurus_kbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zaurus_kbd.c,v 1.32 2011/06/24 19:47:49 naddy Exp $ */ +/* $OpenBSD: zaurus_kbd.c,v 1.33 2011/11/09 14:22:37 shadchin Exp $ */ /* * Copyright (c) 2005 Dale Rahn <drahn@openbsd.org> * @@ -104,10 +104,7 @@ struct zkbd_softc { int sc_rawkbd; #ifdef WSDISPLAY_COMPAT_RAWKBD const char *sc_xt_keymap; - struct timeout sc_rawrepeat_ch; #define MAXKEYS 20 - char sc_rep[MAXKEYS]; - int sc_nrep; #endif }; @@ -137,7 +134,6 @@ struct cfdriver zkbd_cd = { int zkbd_enable(void *, int); void zkbd_set_leds(void *, int); int zkbd_ioctl(void *, u_long, caddr_t, int, struct proc *); -void zkbd_rawrepeat(void *v); struct wskbd_accessops zkbd_accessops = { zkbd_enable, @@ -248,26 +244,8 @@ zkbd_attach(struct device *parent, struct device *self, void *aux) sc->sc_wskbddev = config_found(self, &a, wskbddevprint); timeout_set(&(sc->sc_roll_to), zkbd_poll, sc); -#ifdef WSDISPLAY_COMPAT_RAWKBD - timeout_set(&sc->sc_rawrepeat_ch, zkbd_rawrepeat, sc); -#endif - } -#ifdef WSDISPLAY_COMPAT_RAWKBD -void -zkbd_rawrepeat(void *v) -{ - struct zkbd_softc *sc = v; - int s; - - s = spltty(); - wskbd_rawinput(sc->sc_wskbddev, sc->sc_rep, sc->sc_nrep); - splx(s); - timeout_add(&sc->sc_rawrepeat_ch, hz * REP_DELAYN / 1000); -} -#endif - /* XXX only deal with keys that can be pressed when display is open? */ /* XXX are some not in the array? */ /* handle keypress interrupt */ @@ -287,8 +265,8 @@ zkbd_poll(void *v) int stuck; int keystate; #ifdef WSDISPLAY_COMPAT_RAWKBD - int npress = 0, ncbuf = 0, c; - char cbuf[MAXKEYS *2]; + int ncbuf = 0, c; + char cbuf[MAXKEYS * 2]; #endif s = spltty(); @@ -379,15 +357,8 @@ zkbd_poll(void *v) cbuf[ncbuf++] = 0xe0; } cbuf[ncbuf] = c & 0x7f; - - if (keystate) { - if (c & 0x80) { - sc->sc_rep[npress++] = 0xe0; - } - sc->sc_rep[npress++] = c & 0x7f; - } else { + if (!keystate) cbuf[ncbuf] |= 0x80; - } ncbuf++; sc->sc_okeystate[i] = keystate; } @@ -411,14 +382,8 @@ zkbd_poll(void *v) } #ifdef WSDISPLAY_COMPAT_RAWKBD - if (sc->sc_polling == 0 && sc->sc_rawkbd) { + if (sc->sc_polling == 0 && sc->sc_rawkbd) wskbd_rawinput(sc->sc_wskbddev, cbuf, ncbuf); - sc->sc_nrep = npress; - if (npress != 0) - timeout_add(&sc->sc_rawrepeat_ch, hz * REP_DELAY1/1000); - else - timeout_del(&sc->sc_rawrepeat_ch); - } #endif if (keysdown) timeout_add(&(sc->sc_roll_to), hz * REP_DELAYN / 1000 / 2); @@ -534,7 +499,6 @@ zkbd_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 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) */ }; diff --git a/sys/dev/hil/hilkbd.c b/sys/dev/hil/hilkbd.c index 17b680acaef..7b0a13cf48d 100644 --- a/sys/dev/hil/hilkbd.c +++ b/sys/dev/hil/hilkbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hilkbd.c,v 1.14 2009/01/21 21:53:59 grange Exp $ */ +/* $OpenBSD: hilkbd.c,v 1.15 2011/11/09 14:22:37 shadchin Exp $ */ /* * Copyright (c) 2003, Miodrag Vallat. * All rights reserved. @@ -64,11 +64,6 @@ struct hilkbd_softc { #ifdef WSDISPLAY_COMPAT_RAWKBD int sc_rawkbd; - int sc_nrep; - char sc_rep[HILBUFSIZE * 2]; - struct timeout sc_rawrepeat_ch; -#define REP_DELAY1 400 -#define REP_DELAYN 100 #endif }; @@ -126,7 +121,6 @@ void hilkbd_bell(struct hil_softc *, u_int, u_int, u_int); void hilkbd_callback(struct hildev_softc *, u_int, u_int8_t *); void hilkbd_decode(struct hilkbd_softc *, u_int8_t, u_int *, int *, int); int hilkbd_is_console(int); -void hilkbd_rawrepeat(void *); int seen_hilkbd_console; @@ -196,10 +190,6 @@ hilkbdattach(struct device *parent, struct device *self, void *aux) */ ps2 = (sc->sc_numleds != 0); -#ifdef WSDISPLAY_COMPAT_RAWKBD - timeout_set(&sc->sc_rawrepeat_ch, hilkbd_rawrepeat, sc); -#endif - /* Do not consider button boxes as console devices. */ if (ha->ha_type == HIL_DEVICE_BUTTONBOX) a.console = 0; @@ -315,7 +305,6 @@ hilkbd_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 case WSKBDIO_COMPLEXBELL: @@ -407,9 +396,8 @@ hilkbd_callback(struct hildev_softc *dev, u_int buflen, u_int8_t *buf) #ifdef WSDISPLAY_COMPAT_RAWKBD if (sc->sc_rawkbd) { u_char cbuf[HILBUFSIZE * 2]; - int c, j, npress; + int c, j = 0; - npress = j = 0; for (i = 1, buf++; i < buflen; i++) { hilkbd_decode(sc, *buf++, &type, &key, kbdtype); c = hilkbd_raw[key]; @@ -421,23 +409,12 @@ hilkbd_callback(struct hildev_softc *dev, u_int buflen, u_int8_t *buf) cbuf[j] = c & 0x7f; if (type == WSCONS_EVENT_KEY_UP) cbuf[j] |= 0x80; - else { - /* remember pressed keys for autorepeat */ - 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); - } } else #endif { @@ -480,17 +457,3 @@ hilkbd_is_console(int hil_is_console) seen_hilkbd_console = 1; return (1); } - -#ifdef WSDISPLAY_COMPAT_RAWKBD -void -hilkbd_rawrepeat(void *v) -{ - struct hilkbd_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 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 }; diff --git a/sys/dev/usb/hidkbd.c b/sys/dev/usb/hidkbd.c index 6191a6851a9..cba08e54dc1 100644 --- a/sys/dev/usb/hidkbd.c +++ b/sys/dev/usb/hidkbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hidkbd.c,v 1.4 2010/10/23 16:14:06 jakemsr Exp $ */ +/* $OpenBSD: hidkbd.c,v 1.5 2011/11/09 14:22:38 shadchin Exp $ */ /* $NetBSD: ukbd.c,v 1.85 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -152,10 +152,6 @@ void *hidkbd_bell_fn_arg; void hidkbd_decode(struct hidkbd *, struct hidkbd_data *); void hidkbd_delayed_decode(void *addr); -#ifdef WSDISPLAY_COMPAT_RAWKBD -void hidkbd_rawrepeat(void *); -#endif - extern const struct wscons_keydesc ukbd_keydesctab[]; struct wskbd_mapdata ukbd_keymapdata = { @@ -193,9 +189,6 @@ hidkbd_attach(struct device *self, struct hidkbd *kbd, int console, hidkbd_is_console = 0; } -#ifdef WSDISPLAY_COMPAT_RAWKBD - timeout_set(&kbd->sc_rawrepeat_ch, hidkbd_rawrepeat, kbd); -#endif timeout_set(&kbd->sc_delay, hidkbd_delayed_decode, kbd); return 0; @@ -223,11 +216,6 @@ hidkbd_detach(struct hidkbd *kbd, int flags) DPRINTF(("hidkbd_detach: sc=%p flags=%d\n", kbd->sc_device, flags)); -#ifdef WSDISPLAY_COMPAT_RAWKBD - if (timeout_initialized(&kbd->sc_rawrepeat_ch)) - timeout_del(&kbd->sc_rawrepeat_ch); -#endif - if (kbd->sc_console_keyboard) { #if 0 /* @@ -416,9 +404,8 @@ hidkbd_decode(struct hidkbd *kbd, struct hidkbd_data *ud) if (kbd->sc_rawkbd) { u_char cbuf[MAXKEYS * 2]; int c; - int npress; - for (npress = i = j = 0; i < nkeys; i++) { + for (i = j = 0; i < nkeys; i++) { key = ibuf[i]; c = hidkbd_trtab[key & CODEMASK]; if (c == NN) @@ -428,12 +415,6 @@ hidkbd_decode(struct hidkbd *kbd, struct hidkbd_data *ud) cbuf[j] = c & 0x7f; if (key & RELEASE) cbuf[j] |= 0x80; - else { - /* remember pressed keys for autorepeat */ - if (c & 0x80) - kbd->sc_rep[npress++] = 0xe0; - kbd->sc_rep[npress++] = c & 0x7f; - } DPRINTFN(1,("hidkbd_decode: raw = %s0x%02x\n", c & 0x80 ? "0xe0 " : "", cbuf[j])); @@ -441,11 +422,6 @@ hidkbd_decode(struct hidkbd *kbd, struct hidkbd_data *ud) } s = spltty(); wskbd_rawinput(kbd->sc_wskbddev, cbuf, j); - if (npress != 0) { - kbd->sc_nrep = npress; - timeout_add_msec(&kbd->sc_rawrepeat_ch, REP_DELAY1); - } else - timeout_del(&kbd->sc_rawrepeat_ch); /* * Pass audio keys to wskbd_input anyway. @@ -530,27 +506,12 @@ hidkbd_ioctl(struct hidkbd *kbd, u_long cmd, caddr_t data, int flag, case WSKBDIO_SETMODE: DPRINTF(("hidkbd_ioctl: set raw = %d\n", *(int *)data)); kbd->sc_rawkbd = *(int *)data == WSKBD_RAW; - timeout_del(&kbd->sc_rawrepeat_ch); return (0); #endif } return (-1); } -#ifdef WSDISPLAY_COMPAT_RAWKBD -void -hidkbd_rawrepeat(void *v) -{ - struct hidkbd *kbd = v; - int s; - - s = spltty(); - wskbd_rawinput(kbd->sc_wskbddev, kbd->sc_rep, kbd->sc_nrep); - splx(s); - timeout_add_msec(&kbd->sc_rawrepeat_ch, REP_DELAYN); -} -#endif - void hidkbd_cngetc(struct hidkbd *kbd, u_int *type, int *data) { diff --git a/sys/dev/usb/hidkbdsc.h b/sys/dev/usb/hidkbdsc.h index 484bc25642b..b83a68d71be 100644 --- a/sys/dev/usb/hidkbdsc.h +++ b/sys/dev/usb/hidkbdsc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hidkbdsc.h,v 1.1 2010/07/31 16:04:50 miod Exp $ */ +/* $OpenBSD: hidkbdsc.h,v 1.2 2011/11/09 14:22:38 shadchin Exp $ */ /* $NetBSD: ukbd.c,v 1.85 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -75,13 +75,8 @@ struct hidkbd { struct hidkbd_data sc_data; /* for quirk handling */ /* key repeat logic */ - struct timeout sc_rawrepeat_ch; #if defined(WSDISPLAY_COMPAT_RAWKBD) -#define REP_DELAY1 400 -#define REP_DELAYN 100 int sc_rawkbd; - int sc_nrep; - char sc_rep[MAXKEYS]; #endif /* defined(WSDISPLAY_COMPAT_RAWKBD) */ int sc_polling; |