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

📄 keymap.sh

📁 南京航空航天大学开发的一个类Unix和Linux的操作系统,好不好看看就知道了,
💻 SH
字号:
#!/bin/shecho '/* this file is generated by keymap.sh */struct nullkey_t {	char zgw;};struct charkey_t {	char ascii;	char shift;	char ctrl;};struct stringkey_t {	char * ascii;};struct numpadkey_t {	char lock;	char * unlock;};'echo 'typedef void (*keyhook_t)(void * object, int code);keyhook_t keyhook[] = {'awk 'function name(id){	printf("/*%#04x*/", line++);	return "(keyhook_t) &condev_t::" id "key,"}BEGIN { line=0; }/0x/ {		if (NF >= 2) {		if (index($3, "char"))			print name("char");		else if (index($3, "string"))			print name("string");		else if (index($3, "numpad")) 			print name("numpad");		else if (index($3, "alt"))			print name("alt");		else if (index($3, "shift"))			print name("shift");		else if (index($3, "ctrl"))			print name("ctrl");		else if (index($3, "capslock"))			print name("capslock");		else if (index($3, "numlock"))			print name("numlock");		else if (index($3, "scrollock"))			print name("scrollock");		else {			print "unknown type:" $3; 			exit;		}	} else {		print name("null");	}}'  keymap.defecho '};'awk 'function buildchar(){	if (NF == 6)		ctrl = $6	else 		ctrl = 0;	print "static charkey_t key" $1 "={" $4 "," $5 "," ctrl "};";}function buildstring(){	print "static stringkey_t key" $1 "={" $4 "};";}function buildnumpad(){	print "static numpadkey_t key" $1 "={" $4 "," $5 "};";}function buildnull(){	print "static nullkey_t key" $1 "={0};"}/0x/ {		if (NF >= 2) {		if (index($3, "char"))			buildchar();		else if (index($3, "string"))			buildstring();		else if (index($3, "numpad")) 			buildnumpad();		else				buildnull();	} else {		buildnull();	}}'  keymap.defecho 'static vaddr_t keymap[] = {' awk '/0x/ {	print "(vaddr_t) &key" $1 ","}'  keymap.defecho '};'

⌨️ 快捷键说明

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