Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/usb/input/ukbd.c
Show First 20 Lines • Show All 383 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
UKBD_LOCK_ASSERT(); | UKBD_LOCK_ASSERT(); | ||||
DPRINTF("0x%02x (%d) %s\n", key, key, | DPRINTF("0x%02x (%d) %s\n", key, key, | ||||
(key & KEY_RELEASE) ? "released" : "pressed"); | (key & KEY_RELEASE) ? "released" : "pressed"); | ||||
#ifdef EVDEV_SUPPORT | #ifdef EVDEV_SUPPORT | ||||
if (evdev_rcpt_mask & EVDEV_RCPT_HW_KBD && sc->sc_evdev != NULL) { | if (evdev_rcpt_mask & EVDEV_RCPT_HW_KBD && sc->sc_evdev != NULL) | ||||
evdev_push_event(sc->sc_evdev, EV_KEY, | evdev_push_event(sc->sc_evdev, EV_KEY, | ||||
evdev_hid2key(KEY_INDEX(key)), !(key & KEY_RELEASE)); | evdev_hid2key(KEY_INDEX(key)), !(key & KEY_RELEASE)); | ||||
evdev_sync(sc->sc_evdev); | |||||
} | |||||
#endif | #endif | ||||
if (sc->sc_inputs < UKBD_IN_BUF_SIZE) { | if (sc->sc_inputs < UKBD_IN_BUF_SIZE) { | ||||
sc->sc_input[sc->sc_inputtail] = key; | sc->sc_input[sc->sc_inputtail] = key; | ||||
++(sc->sc_inputs); | ++(sc->sc_inputs); | ||||
++(sc->sc_inputtail); | ++(sc->sc_inputtail); | ||||
if (sc->sc_inputtail >= UKBD_IN_BUF_SIZE) { | if (sc->sc_inputtail >= UKBD_IN_BUF_SIZE) { | ||||
sc->sc_inputtail = 0; | sc->sc_inputtail = 0; | ||||
▲ Show 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | if (sc->sc_repeat_key != 0) { | ||||
const int32_t dtime = (sc->sc_repeat_time - now); | const int32_t dtime = (sc->sc_repeat_time - now); | ||||
/* check if time has elapsed */ | /* check if time has elapsed */ | ||||
if (dtime <= 0) { | if (dtime <= 0) { | ||||
ukbd_put_key(sc, sc->sc_repeat_key | KEY_PRESS); | ukbd_put_key(sc, sc->sc_repeat_key | KEY_PRESS); | ||||
sc->sc_repeat_time = now + sc->sc_kbd.kb_delay2; | sc->sc_repeat_time = now + sc->sc_kbd.kb_delay2; | ||||
} | } | ||||
} | } | ||||
#ifdef EVDEV_SUPPORT | |||||
if (evdev_rcpt_mask & EVDEV_RCPT_HW_KBD && sc->sc_evdev != NULL) | |||||
evdev_sync(sc->sc_evdev); | |||||
#endif | |||||
/* wakeup keyboard system */ | /* wakeup keyboard system */ | ||||
ukbd_event_keyinput(sc); | ukbd_event_keyinput(sc); | ||||
} | } | ||||
static void | static void | ||||
ukbd_event_keyinput(struct ukbd_softc *sc) | ukbd_event_keyinput(struct ukbd_softc *sc) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 1,621 Lines • Show Last 20 Lines |