devkbd.c

来自「神龙卡开发原代码」· C语言 代码 · 共 52 行

C
52
字号
/* * Copyright (c) 1999 Greg Haerr <greg@censoft.com> * * Device-independent keyboard routines */#include "device.h"/* * Open the keyboard. */intGdOpenKeyboard(void){	int	fd;	if ((fd = kbddev.Open(&kbddev)) == -1)		return -1;	/* possible -2 return means no kbd*/	return fd;}/* * Close the keyboard. */voidGdCloseKeyboard(void){	kbddev.Close();}/* * Return the possible modifiers for the keyboard. */voidGdGetModifierInfo(MWKEYMOD *modifiers, MWKEYMOD *curmodifiers){	kbddev.GetModifierInfo(modifiers, curmodifiers);}/* * This reads one keystroke from the keyboard, and the current state of * the mode keys (ALT, SHIFT, CTRL).  Returns -1 on error, 0 if no data * is ready, 1 if keypress, 2 if keyrelease. * This is a non-blocking call.  Returns -2 if ESC pressed. */intGdReadKeyboard(MWKEY *buf, MWKEYMOD *modifiers, MWSCANCODE *scancode){	return kbddev.Read(buf, modifiers, scancode);}

⌨️ 快捷键说明

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