aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Kondratyev <wulf@FreeBSD.org>2021-02-13 18:12:56 +0000
committerVladimir Kondratyev <wulf@FreeBSD.org>2021-02-23 23:41:49 +0000
commite7211ca03a85e3a980daf389af823fefb24b8869 (patch)
tree05811ae3612c0c2de6f68ceda39c28c7c2281b79
parent9262a9ce06a697c7459a03d559b980673fd9c934 (diff)
downloadsrc-e7211ca03a85e3a980daf389af823fefb24b8869.tar.gz
src-e7211ca03a85e3a980daf389af823fefb24b8869.zip
ukbd: Fix handling of keyboard ErrorRollOver reports
Ignore fantom keyboard state reports entirelly rather than ignore RollOver states for each key separatelly. Latter results in spurious release/push pairs of events on each fantom keyboard state report. Reported by: Jan Martin Mikkelsen <janm_AT_transactionware_DOT_com> Submitted by: Jan Martin Mikkelsen (initial version) PR: 253249 MFC after: 1 week (cherry picked from commit 032d3153877ef1767c121bbdf8e00f4f93b30a5d)
-rw-r--r--sys/dev/usb/input/ukbd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c
index 3314a3b3e70f..f2ff476150ff 100644
--- a/sys/dev/usb/input/ukbd.c
+++ b/sys/dev/usb/input/ukbd.c
@@ -722,11 +722,16 @@ ukbd_intr_callback(struct usb_xfer *xfer, usb_error_t error)
hid_get_udata(sc->sc_buffer, len, &tmp_loc);
/* advance to next location */
tmp_loc.pos += tmp_loc.size;
+ if (key == KEY_ERROR) {
+ DPRINTF("KEY_ERROR\n");
+ sc->sc_ndata = sc->sc_odata;
+ goto tr_setup; /* ignore */
+ }
if (modifiers & MOD_FN)
key = ukbd_apple_fn(key);
if (sc->sc_flags & UKBD_FLAG_APPLE_SWAP)
key = ukbd_apple_swap(key);
- if (key == KEY_NONE || key == KEY_ERROR || key >= UKBD_NKEYCODE)
+ if (key == KEY_NONE || key >= UKBD_NKEYCODE)
continue;
/* set key in bitmap */
sc->sc_ndata.bitmap[key / 64] |= 1ULL << (key % 64);