1
0
Fork 0

colorize :?

This commit is contained in:
mfranz 2008-10-01 13:40:43 +00:00
parent 273788c75e
commit ac1fbbbd66

View file

@ -47,22 +47,38 @@
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script> <script>
var curr = 0; var (curr, title) = (0, "");
foreach (var k; sort(multikey.data, func(a, b) cmp(a[0], b[0]))) { foreach (var k; sort(multikey.data, func(a, b) cmp(a[0], b[0]))) {
var bndg = k[1].getChildren("binding"); var bndg = k[1].getChildren("binding");
if (!size(bndg)) var desc = k[1].getNode("desc", 1).getValue() or "??";
continue; if (size(k[0]) == 1 or k[0][0] == `%`)
if (size(bndg) == 1 and bndg[0].getNode("command", 1).getValue() == "null") title = desc;
if (!size(bndg) or size(bndg) == 1
and bndg[0].getNode("command", 1).getValue() == "null")
continue; continue;
if (k[0][0] != curr) { if (k[0][0] != curr) {
curr = k[0][0]; curr = k[0][0];
print("------------------------------------------"); var line = "--------------------------------------------";
printf("-- %s %s", title, substr(line, size(title) + 2));
} }
printf("%s\t%s", k[0], k[1].getNode("desc", 1).getValue() or "??"); var cmd = k[0];
cmd = string.replace(cmd, "%u", debug._c("32", "%u"));
cmd = string.replace(cmd, "%d", debug._c("31", "%d"));
cmd = string.replace(cmd, "%f", debug._c("36", "%f"));
cmd = string.replace(cmd, "&lt;", debug._c("35", "&lt;"));
cmd = string.replace(cmd, "&gt;", debug._c("35", "&gt;"));
cmd = string.replace(cmd, "^", debug._c("35", "^"));
cmd = string.replace(cmd, "_", debug._c("35", "_"));
printf("%s\t%s", cmd, desc);
} }
print("------------------------------------------\n\tLegend:"); print("------------------------------------------\n\tLegend:\n");
print("\n\t%u ... unsigned number\n\t%d ... signed number\n\t%f ... floation point number"); printf("\t%s ... unsigned number", debug._c("32", "%u"));
print("\t&lt; ... cursor left\n\t> ... cursor right\n\t^ ... cursor up\n\t_ ... cursor down"); printf("\t%s ... signed number", debug._c("31", "%d"));
printf("\t%s ... floation point number", debug._c("36", "%f"));
printf("\t%s ... cursor left", debug._c("35", "&lt;"));
printf("\t%s ... cursor right", debug._c("35", ">"));
printf("\t%s ... cursor up", debug._c("35", "^"));
printf("\t%s ... cursor down", debug._c("35", "_"));
</script> </script>
</binding> </binding>
</key> </key>
@ -944,8 +960,8 @@
</binding> </binding>
</key> </key>
<key n="119"> <key n="115">
<name>w</name> <name>s</name>
<desc>Wing sweep</desc> <desc>Wing sweep</desc>
<key n="901"> <key n="901">
<name>%f</name> <name>%f</name>