From 0f924d84542637d649699b5134be4b12e1cde249 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Tue, 13 Oct 2009 20:56:51 +0000 Subject: Pass audio keys to the audio layer even when the keyboard is in raw mode, to match what pckbd does; reported by mk@ --- sys/dev/usb/ukbd.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'sys/dev') 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 -- cgit v1.2.3