Documented what the heck I meant by 'ptx', 'lsi', etc. etc. Also where
the numbers came from, but the simplest answer is that you start a
simple dump of the registers to your console while holding the device
in your hand and you rotate it to the various positions, writing down
the numbers you see and then tuning as necessary. Programming as an
empirical science, not a theoretical one.
Also: I have a really (REALLY) silly script that lets me see all the
projects currently underway in my ~/Projects directory, and it looks for
the DESCRIPTION.md file. So that's what you're getting.
The rotation detection rules were too simple, and too general, and
caused the system to flicker madly if you weren't holding it upright
at more than a 40° angle. This was mostly due to my misreading the
original algorithm. This instance currently matches Poel's algorithm
and remembers to quit once a matching geometry has been found. It's
much more stable and pleasant to use.
A bit of a cruftectomy; removed most of the reportage displays,
and enabled dynamic scanning of the device list so that the
stylus & eraser now remap automatically, even after they've
been added dynamically via modprobe. Signficantly reduced
the number of shell-outs as well
As is my usual nature, I removed almost all the case handling and
replaced it with a table, which is DRY: Every piece of knowledge must
have a single, unambiguous, authoritative representation within a system.
The table has a name, number, transformation matrix, and x and y
orientation check functions. Everything else is just checking on
that.
Quick and dirty fix... Script now looks for an external display before trying to rotate the screen. If one is present it will automatically deactivate autorotation of the internal screen.