A simple blocking read of the touch event file seems to do the trick just fine. No need for any polling, and Nickel is happy to keep processing touch events while doing so.
The test program doesn't even register in 'top', so hopefully this approach wouldn't be a battery hog.
Oh, and I've basically created a simple C touch "driver" that applications can integrate if they so desire (I ported my Go code to C). It needs a bit of tidying up before release however, and I'm not sure if I've accounted for all the different "protocols" correctly.
|