+#endif
+#ifdef USE_TERM_DRIVER
+ if ((sp->_mouse_type == M_TERM_DRIVER)
+ && (sp->_drv_mouse_head < sp->_drv_mouse_tail)) {
+ sp->_mouse_event(sp);
+ ch = KEY_MOUSE;
+ n = 1;
+ } else
+#endif
+#if USE_KLIBC_KBD
+ if (isatty(sp->_ifd) && sp->_cbreak) {
+ ch = _read_kbd(0, 1, !sp->_raw);
+ n = (ch == -1) ? -1 : 1;
+ sp->_extended_key = (ch == 0);
+ } else