本文整理汇总了C++中KBD_IS_ACTIVE函数的典型用法代码示例。如果您正苦于以下问题:C++ KBD_IS_ACTIVE函数的具体用法?C++ KBD_IS_ACTIVE怎么用?C++ KBD_IS_ACTIVE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了KBD_IS_ACTIVE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: akbd_check
static int
akbd_check(keyboard_t *kbd)
{
struct adb_kbd_softc *sc;
if (!KBD_IS_ACTIVE(kbd))
return (FALSE);
sc = (struct adb_kbd_softc *)(kbd);
mtx_lock(&sc->sc_mutex);
#ifdef AKBD_EMULATE_ATKBD
if (sc->at_buffered_char[0]) {
mtx_unlock(&sc->sc_mutex);
return (TRUE);
}
#endif
if (sc->buffers > 0) {
mtx_unlock(&sc->sc_mutex);
return (TRUE);
}
mtx_unlock(&sc->sc_mutex);
return (FALSE);
}
示例2: akbd_repeat
static void
akbd_repeat(void *xsc) {
struct adb_kbd_softc *sc = xsc;
int notify_kbd = 0;
/* Fake an up/down key repeat so long as we have the
free buffers */
mtx_lock(&sc->sc_mutex);
if (sc->buffers < 7) {
sc->buffer[sc->buffers++] = sc->last_press | (1 << 7);
sc->buffer[sc->buffers++] = sc->last_press;
notify_kbd = 1;
}
mtx_unlock(&sc->sc_mutex);
if (notify_kbd && KBD_IS_ACTIVE(&sc->sc_kbd)
&& KBD_IS_BUSY(&sc->sc_kbd)) {
sc->sc_kbd.kb_callback.kc_func(&sc->sc_kbd,
KBDIO_KEYINPUT, sc->sc_kbd.kb_callback.kc_arg);
}
/* Reschedule the callout */
callout_reset(&sc->sc_repeater, ms_to_ticks(sc->sc_kbd.kb_delay2),
akbd_repeat, sc);
}
示例3: pckbd_check
/* check if data is waiting */
static int
pckbd_check(keyboard_t *kbd)
{
if (!KBD_IS_ACTIVE(kbd))
return FALSE;
return kbdc_data_ready(((pckbd_state_t *)kbd->kb_data)->kbdc);
}
示例4: ckb_check
/* check if data is waiting */
static int
ckb_check(keyboard_t *kbd)
{
struct ckb_softc *sc;
int i;
sc = kbd->kb_data;
CKB_CTX_LOCK_ASSERT();
if (!KBD_IS_ACTIVE(kbd))
return (0);
if (sc->sc_flags & CKB_FLAG_POLLING) {
return (1);
};
for (i = 0; i < sc->cols; i++)
if (sc->scan_local[i] != sc->scan[i]) {
return (1);
};
if (sc->sc_repeating)
return (1);
return (0);
}
示例5: sunkbd_check
static int
sunkbd_check(keyboard_t *kbd)
{
struct sunkbd_softc *sc;
if (!KBD_IS_ACTIVE(kbd))
return (FALSE);
sc = (struct sunkbd_softc *)kbd;
#if defined(SUNKBD_EMULATE_ATKBD)
if (sc->sc_buffered_char[0])
return (TRUE);
#endif
if (sc->sc_repeating)
return (TRUE);
if (sc->sc_uart != NULL && !uart_rx_empty(sc->sc_uart))
return (TRUE);
if (sc->sc_polling != 0 && sc->sc_sysdev != NULL &&
uart_rxready(sc->sc_sysdev))
return (TRUE);
return (FALSE);
}
示例6: atkbd_intr
/* keyboard interrupt routine */
static int
atkbd_intr(keyboard_t *kbd, void *arg)
{
atkbd_state_t *state;
int delay[2];
int c;
if (KBD_IS_ACTIVE(kbd) && KBD_IS_BUSY(kbd)) {
/* let the callback function to process the input */
(*kbd->kb_callback.kc_func)(kbd, KBDIO_KEYINPUT,
kbd->kb_callback.kc_arg);
} else {
/* read and discard the input; no one is waiting for input */
do {
c = atkbd_read_char(kbd, FALSE);
} while (c != NOKEY);
if (!KBD_HAS_DEVICE(kbd)) {
/*
* The keyboard was not detected before;
* it must have been reconnected!
*/
state = (atkbd_state_t *)kbd->kb_data;
init_keyboard(state->kbdc, &kbd->kb_type,
kbd->kb_config);
atkbd_ioctl(kbd, KDSETLED, (caddr_t)&state->ks_state);
get_typematic(kbd);
delay[0] = kbd->kb_delay1;
delay[1] = kbd->kb_delay2;
atkbd_ioctl(kbd, KDSETREPEAT, (caddr_t)delay);
KBD_FOUND_DEVICE(kbd);
}
}
return 0;
}
示例7: akbd_check_char
static int
akbd_check_char(keyboard_t *kbd)
{
if (!KBD_IS_ACTIVE(kbd))
return (FALSE);
return (akbd_check(kbd));
}
示例8: kmi_check_char_locked
/* check if char is waiting */
static int
kmi_check_char_locked(keyboard_t *kbd)
{
KMI_CTX_LOCK_ASSERT();
if (!KBD_IS_ACTIVE(kbd))
return (0);
return (kmi_check(kbd));
}
示例9: ckb_check_char_locked
/* check if char is waiting */
static int
ckb_check_char_locked(keyboard_t *kbd)
{
CKB_CTX_LOCK_ASSERT();
if (!KBD_IS_ACTIVE(kbd))
return (0);
return (ckb_check(kbd));
}
示例10: ckb_read
/* Currently unused. */
static int
ckb_read(keyboard_t *kbd, int wait)
{
CKB_CTX_LOCK_ASSERT();
if (!KBD_IS_ACTIVE(kbd))
return (-1);
printf("Implement ME: %s\n", __func__);
return (0);
}
示例11: pckbd_read
/* read one byte from the keyboard if it's allowed */
static int
pckbd_read(keyboard_t *kbd, int wait)
{
int c;
if (wait)
c = read_kbd_data(((pckbd_state_t *)kbd->kb_data)->kbdc);
else
c = read_kbd_data_no_wait(((pckbd_state_t *)kbd->kb_data)->kbdc);
return (KBD_IS_ACTIVE(kbd) ? c : -1);
}
示例12: pckbd_check_char
/* check if char is waiting */
static int
pckbd_check_char(keyboard_t *kbd)
{
pckbd_state_t *state;
if (!KBD_IS_ACTIVE(kbd))
return FALSE;
state = (pckbd_state_t *)kbd->kb_data;
if (!(state->ks_flags & COMPOSE) && (state->ks_composed_char > 0))
return TRUE;
return kbdc_data_ready(state->kbdc);
}
示例13: kmi_read
/* Currently unused. */
static int
kmi_read(keyboard_t *kbd, int wait)
{
KMI_CTX_LOCK_ASSERT();
if (!KBD_IS_ACTIVE(kbd))
return (-1);
++(kbd->kb_count);
printf("Implement ME: %s\n", __func__);
return (0);
}
示例14: ukbd_check
/* check if data is waiting */
static int
ukbd_check(keyboard_t *kbd)
{
if (!KBD_IS_ACTIVE(kbd))
return FALSE;
#ifdef UKBD_EMULATE_ATSCANCODE
if (((ukbd_state_t *)kbd->kb_data)->ks_buffered_char[0])
return TRUE;
#endif
if (((ukbd_state_t *)kbd->kb_data)->ks_inputs > 0)
return TRUE;
return FALSE;
}
示例15: sunkbd_repeat
static void
sunkbd_repeat(void *v)
{
struct sunkbd_softc *sc = v;
if (KBD_IS_ACTIVE(&sc->sc_kbd) && KBD_IS_BUSY(&sc->sc_kbd)) {
if (sc->sc_repeat_key != -1) {
sc->sc_repeating = 1;
sc->sc_kbd.kb_callback.kc_func(&sc->sc_kbd,
KBDIO_KEYINPUT, sc->sc_kbd.kb_callback.kc_arg);
}
}
}