Hi 9fans,

I have most of a working prototype of a Go Shiny driver for Plan9, but
there's a couple issues that I'd like to resolve and cleanup that I'd like
to do.

First, reads and writes to /dev/draw/n/data seem to fail if it's larger
than 65536 bytes. At 4 bytes per pixel, that's not very much (that means
the image you can read is 128x128, and the biggest you can write slightly
smaller with the overhead of the header for the write..) As a hack, I'm
splitting up the calls for rectangles larger than that when reading or
writing ('r' and 'y' messages from draw(3)) into 1 read/write per row. But
65536 bytes still seems pretty artificially low? Is there any other way
around it? I'm not even sure if it's Go, Plan9, or drawterm that's adding
this restriction..

Second, I'd like to improve the keyboard handling. Right now I'm just
assuming that reading 'a' off /dev/cons came from the a key, 'A' came from
shift-A, etc. I'd like to load /dev/kbmap and make a more intelligent guess
of "the first key code which matches this utf8 rune in the kbmap" but man
kbmap is only partially helpful. It says that column 1 is "a table number"
and column 2 is "a hardware specific scan code". I think it's safe to
assume that table 0 is the unmodified key, but other than that does anyone
have any pointers for how to go from "table number" to "modifiers which
that table represents" and "hardware specific scan code" to "USB HID Key
Code"?

- Dave

Reply via email to