2007-02-26 14:53:02 +03:00
|
|
|
#!AWKPATH -f
|
2007-02-23 02:32:23 +03:00
|
|
|
BEGIN {
|
|
|
|
arg[1] = "Nop"
|
2007-03-08 00:08:19 +03:00
|
|
|
body = "";
|
2007-02-23 02:32:23 +03:00
|
|
|
writekeys = "wmiir write /keys"
|
2007-03-07 18:38:31 +03:00
|
|
|
print "IFS=''"
|
2007-02-23 02:32:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function addevent() {
|
2007-03-07 22:01:02 +03:00
|
|
|
if(arg[1] == "Key")
|
|
|
|
keys[arg[2]] = 1;
|
2007-03-07 18:38:31 +03:00
|
|
|
|
|
|
|
var = arg[1] "s"
|
2007-03-07 22:01:02 +03:00
|
|
|
print var "=\"$" var " " arg[2] "\""
|
2007-03-07 18:38:31 +03:00
|
|
|
|
|
|
|
gsub("[^a-zA-Z_0-9]", "_", arg[2]);
|
2007-03-08 00:08:19 +03:00
|
|
|
if(body != "")
|
|
|
|
print arg[1] "_" arg[2] "() {" body "\n}"
|
2007-02-23 02:32:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/^(Event|Key|Action)[ \t]/ {
|
|
|
|
addevent()
|
|
|
|
split($0, arg)
|
|
|
|
body = ""
|
|
|
|
}
|
|
|
|
/^[ \t]/ {
|
|
|
|
body = body"\n"$0
|
|
|
|
}
|
|
|
|
|
|
|
|
END {
|
2007-03-07 18:38:31 +03:00
|
|
|
addevent()
|
2007-02-23 02:32:23 +03:00
|
|
|
for(key in keys)
|
2007-03-07 22:01:02 +03:00
|
|
|
print key | writekeys;
|
2007-03-07 18:38:31 +03:00
|
|
|
close(writekeys);
|
2007-02-23 02:32:23 +03:00
|
|
|
}
|