Fuzzyzilla / octotablet

High-level Tablet/Stylus API for Rust
https://crates.io/crates/octotablet
MIT License
14 stars 2 forks source link

Ink `RealTimeStylus` Support #1

Closed Fuzzyzilla closed 3 months ago

Fuzzyzilla commented 3 months ago

Unfinished and not plumbed into the main interfaces yet. Mostly just dumps a bunch of debug info to the console. It took a lot of learning to get this far but I do have access to the stylus data streams, so some progress there. The trouble is in their interpretation.

From some empirical checks none of.. anything makes much sense. One device reports position in Centimeters but the values are actually pixels. Others report Centimeters but they're actually some device-specific unit. Every wacom I've tried reports pressure in angular degrees. I'm to the point where I can't help but feel that I cannot trust the output of the API, and at that point, what is there to do!

Pressures and angles can be renormalized. Take whatever untrustworthy unit and range and squash em down into something reasonable for the axis in question. This is implemented to some extent, but the main blocker is the position axes - There is no basis to renormalize onto and thus nowhere for me to go. I could fetch the cursor position and determine in realtime what the scale factor looks like, but this adds increased complexity and messiness like trying to correlate the timing of the stylus dataframes and the desktop cursor. And at that point, why even bother with the RTS api when I could just report from, say, the WINUSER Pointer api.

I've been stalled on this branch for some time now, and I'm gonna take a break. Maybe to revisit, maybe not :3 Either way, if someone else wants to take a crack at this, please do. Note the code is a nightmare, my apologies - hacks upon hacks as I try to wrap my tiny mind around the beeste that is winapi.

Fuzzyzilla commented 3 months ago

The main blocker has been cleared, rewrites in progress :3 Gosh it's going so fast now.