diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-10-13 20:56:51 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-10-13 20:56:51 +0000 |
commit | 0f924d84542637d649699b5134be4b12e1cde249 (patch) | |
tree | 5b880b247bab84f16de26d2c8dfb3b1a4d8fb4a5 | |
parent | 93e592206004939f5faacc08c33c71a84c919c4b (diff) |
Pass audio keys to the audio layer even when the keyboard is in raw mode,
to match what pckbd does; reported by mk@
-rw-r--r-- | sys/dev/usb/ukbd.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c index 7cc4667996a..5eac2d720ca 100644 --- a/sys/dev/usb/ukbd.c +++ b/sys/dev/usb/ukbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ukbd.c,v 1.47 2009/10/13 19:33:19 pirofti Exp $ */ +/* $OpenBSD: ukbd.c,v 1.48 2009/10/13 20:56:50 miod Exp $ */ /* $NetBSD: ukbd.c,v 1.85 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -679,12 +679,29 @@ ukbd_decode(struct ukbd_softc *sc, struct ukbd_data *ud) } s = spltty(); wskbd_rawinput(sc->sc_wskbddev, cbuf, j); - splx(s); if (npress != 0) { sc->sc_nrep = npress; timeout_add_msec(&sc->sc_rawrepeat_ch, REP_DELAY1); } else timeout_del(&sc->sc_rawrepeat_ch); + + /* + * Pass audio keys to wskbd_input anyway. + */ + for (i = 0; i < nkeys; i++) { + key = ibuf[i]; + switch (key & CODEMASK) { + case 127: + case 128: + case 129: + wskbd_input(sc->sc_wskbddev, + key & RELEASE ? WSCONS_EVENT_KEY_UP : + WSCONS_EVENT_KEY_DOWN, key & CODEMASK); + break; + } + } + splx(s); + return; } #endif |