keymap.pl

来自「Nxlib,一个模拟xlib的程序。使用microwindows的库来运行需要x」· PL 代码 · 共 36 行

PL
36
字号
#!/usr/bin/perl# A quick perl script that reads the /usr/include/X11/keysymdef.h file # and constructs a header file for easy comparision with an incoming string my($header) = "$ARGV[0]/keysymdef.h";my($count) = 0;open(FILE, $header) or die "Oops, couldn't open $header";print "/* X Keysym header file    */\n";print "/* Automatically generated */\n";print "\n";print "struct {\n";print "char str[30];\n";print "KeySym keysym;\n";print "} nxKeyStrings[] = {\n";while(<FILE>) {    if (/#define (\w*)\s*(\w*)/) {	my($keysym) = $1;	my($value) =  $2;	        $keysym =~ /XK_(.*)/;	if ($count != 0) {	    print ",\n";	}	print "{\"$1\", $value }";	$count++;    }}print "\n}\;\n";print "#define NX_KEYSYMSTR_COUNT $count\n";

⌨️ 快捷键说明

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