⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kbd_null.c

📁 开放源码实时操作系统源码.
💻 C
字号:
/*
 * Copyright (c) 2000, 2002 Greg Haerr <greg@censoft.com>
 *
 * Null Keyboard Driver
 */
#include <stdio.h>
#include "device.h"

static int  NUL_Open(KBDDEVICE *pkd);
static void NUL_Close(void);
static void NUL_GetModifierInfo(MWKEYMOD *modifiers, MWKEYMOD *curmodifiers);
static int  NUL_Read(MWUCHAR *buf, MWKEYMOD *modifiers, MWSCANCODE *scancode);
static int  NUL_Poll(void);

KBDDEVICE kbddev = {
	NUL_Open,
	NUL_Close,
	NUL_GetModifierInfo,
	NUL_Read,
	NUL_Poll
};

/*
 * Poll for keyboard events
 */
static int
NUL_Poll(void)
{
	return 0;
}

/*
 * Open the keyboard.
 */
static int
NUL_Open(KBDDEVICE *pkd)
{
	return -2;	/* no kbd*/
}

/*
 * Close the keyboard.
 */
static void
NUL_Close(void)
{
}

/*
 * Return the possible modifiers for the keyboard.
 */
static  void
NUL_GetModifierInfo(MWKEYMOD *modifiers, MWKEYMOD *curmodifiers)
{
	if (modifiers)
		*modifiers = 0;		/* no modifiers available */
	if (curmodifiers)
		*curmodifiers = 0;
}

/*
 * This reads one keystroke from the keyboard, and the current state of
 * the modifier keys (ALT, SHIFT, etc).  Returns -1 on error, 0 if no data
 * is ready, 1 on a keypress, and 2 on keyrelease.
 * This is a non-blocking call.
 */
static int
NUL_Read(MWUCHAR *buf, MWKEYMOD *modifiers, MWSCANCODE *scancode)
{
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -