2007-02-26 14:53:02 +03:00
|
|
|
#!AWKPATH -f
|
2007-02-23 02:32:23 +03:00
|
|
|
BEGIN {
|
|
|
|
arg[1] = "Nop"
|
|
|
|
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 18:38:31 +03:00
|
|
|
if(arg[1] == Key)
|
|
|
|
keys[arg[1]] = 1;
|
|
|
|
|
|
|
|
var = arg[1] "s"
|
|
|
|
print var "=\"$" var "\n" arg[1] "\""
|
|
|
|
|
|
|
|
gsub("[^a-zA-Z_0-9]", "_", arg[2]);
|
|
|
|
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)
|
|
|
|
print key | writekeys
|
2007-03-07 18:38:31 +03:00
|
|
|
close(writekeys);
|
2007-02-23 02:32:23 +03:00
|
|
|
}
|