aboutsummaryrefslogtreecommitdiffstats
path: root/name.sh
blob: 9da92fc53c4919ee4578623d699be9e3882f0229 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

TYPE="$1"
INPUT="/usr/include/linux/input.h"

awk "
	/KEY_MIN_INTERESTING/	{next};
	/EV_VERSION/	{ next };
	/_MAX/		{ next };
	/_CNT/		{ next };
	/#define $1_/	{ 
		name = \$2;
                if (\"$TYPE\" != \"BTN\") {
			sub(\"^${TYPE}_\", \"\", name);
		}
		printf(\"\t[ %-16s ] = \\\"%s\\\",\n\", \$2, name);
	}
" < $INPUT