• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ KBD_IS_ACTIVE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中KBD_IS_ACTIVE函数的典型用法代码示例。如果您正苦于以下问题:C++ KBD_IS_ACTIVE函数的具体用法?C++ KBD_IS_ACTIVE怎么用?C++ KBD_IS_ACTIVE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了KBD_IS_ACTIVE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:ele7enxxh,项目名称:dtrace-pf,代码行数:26,代码来源:adb_kbd.c


示例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);
}
开发者ID:ele7enxxh,项目名称:dtrace-pf,代码行数:26,代码来源:adb_kbd.c


示例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);
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:8,代码来源:pc98kbd.c


示例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);
}
开发者ID:ChristosKa,项目名称:freebsd,代码行数:28,代码来源:chrome_kb.c


示例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);
}
开发者ID:AhmadTux,项目名称:freebsd,代码行数:27,代码来源:uart_kbd_sun.c


示例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;
}
开发者ID:MarginC,项目名称:kame,代码行数:36,代码来源:atkbd.c


示例7: akbd_check_char

static int 
akbd_check_char(keyboard_t *kbd) 
{
	if (!KBD_IS_ACTIVE(kbd))
		return (FALSE);

	return (akbd_check(kbd));
}
开发者ID:ele7enxxh,项目名称:dtrace-pf,代码行数:8,代码来源:adb_kbd.c


示例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));
}
开发者ID:ele7enxxh,项目名称:dtrace-pf,代码行数:11,代码来源:pl050.c


示例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));
}
开发者ID:ChristosKa,项目名称:freebsd,代码行数:11,代码来源:chrome_kb.c


示例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);
}
开发者ID:ChristosKa,项目名称:freebsd,代码行数:12,代码来源:chrome_kb.c


示例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);
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:12,代码来源:pc98kbd.c


示例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);
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:13,代码来源:pc98kbd.c


示例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);
}
开发者ID:ele7enxxh,项目名称:dtrace-pf,代码行数:13,代码来源:pl050.c


示例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;
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:14,代码来源:ukbd.c


示例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);
		}
	}
}
开发者ID:AhmadTux,项目名称:freebsd,代码行数:13,代码来源:uart_kbd_sun.c


示例16: ukbd_check_char

/* check if char is waiting */
static int
ukbd_check_char(keyboard_t *kbd)
{
	ukbd_state_t *state;

	if (!KBD_IS_ACTIVE(kbd))
		return FALSE;
	state = (ukbd_state_t *)kbd->kb_data;
	if (!(state->ks_flags & COMPOSE) && (state->ks_composed_char > 0))
		return TRUE;
	if (state->ks_inputs > 0)
		return TRUE;
	return FALSE;
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:15,代码来源:ukbd.c


示例17: kmi_check

/* check if data is waiting */
static int
kmi_check(keyboard_t *kbd)
{
	struct kmi_softc *sc = kbd->kb_data;
	uint32_t reg;

	KMI_CTX_LOCK_ASSERT();

	if (!KBD_IS_ACTIVE(kbd))
		return (0);

	reg = pl050_kmi_read_4(sc, KMIIR);
	return (reg & KMIIR_RXINTR);
}
开发者ID:ele7enxxh,项目名称:dtrace-pf,代码行数:15,代码来源:pl050.c


示例18: pckbd_intr

/* keyboard interrupt routine */
static int
pckbd_intr(keyboard_t *kbd, void *arg)
{
	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 = pckbd_read_char(kbd, FALSE);
		} while (c != NOKEY);
	}
	return 0;
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:18,代码来源:pc98kbd.c


示例19: sunkbd_uart_intr

static void
sunkbd_uart_intr(void *arg)
{
	struct sunkbd_softc *sc = arg;
	int pend;

	if (sc->sc_uart->sc_leaving)
		return;

	pend = atomic_readandclear_32(&sc->sc_uart->sc_ttypend);
	if (!(pend & SER_INT_MASK))
		return;

	if (pend & SER_INT_RXREADY) {
		if (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);
		}
	}
}
开发者ID:AhmadTux,项目名称:freebsd,代码行数:20,代码来源:uart_kbd_sun.c


示例20: kmi_read_char_locked

/* read char from the keyboard */
static uint32_t
kmi_read_char_locked(keyboard_t *kbd, int wait)
{
	struct kmi_softc *sc = kbd->kb_data;
	uint32_t reg, data;

	KMI_CTX_LOCK_ASSERT();

	if (!KBD_IS_ACTIVE(kbd))
		return (NOKEY);

	reg = pl050_kmi_read_4(sc, KMIIR);
	if (reg & KMIIR_RXINTR) {
		data = pl050_kmi_read_4(sc, KMIDATA);
		return (data);
	}

	++kbd->kb_count;
	return (NOKEY);
}
开发者ID:ele7enxxh,项目名称:dtrace-pf,代码行数:21,代码来源:pl050.c



注:本文中的KBD_IS_ACTIVE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ KBE_ASSERT函数代码示例发布时间:2022-05-30
下一篇:
C++ KBASE_DEBUG_ASSERT函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap