Files
DroidDeck/docs
alien2003andalien2003 de70e37f30 feat(ctl): input pen draws with a virtual pen through Android's input reader (#2639)
droiddeckctl input pen hover, tap, stroke and button register a virtual
direct pen with `adb shell uinput -` and play the gesture through it, so
Android's input reader makes the same stylus events a built-in pen does,
with pressure, tilt, distance, the eraser and both side buttons. The app
is not involved, which lets pen handling be tested without a pen.
Positions are fractions of the screen as shown, placed inside the
physical frame of the internal display viewport in dumpsys input: the
frame is smaller than the panel when `wm size` sets another aspect
ratio, and Android drops pen events outside it. The rotation and size
come from the same viewport. The values are checked before anything
runs on the device.

The script waits 1 s after registering, since uinput reads it in one go
and cannot wait for the device, and does not reset uinput's time base
after that, which would drop the first samples. Contact sends a pressure
of at least 1, because Android takes a pen at pressure 0 for a hovering
one, and a lift first moves to where it lifts, because Android's UP
repeats the last contact. A pen held still moves by one unit without
leaving the physical frame so that it keeps reporting, since the kernel
drops frames that change nothing.

Co-authored-by: alien2003 <11610652+alien2003@users.noreply.github.com>
2026-11-15 09:37:56 -05:00
..
2026-10-30 21:57:32 -04:00
2026-10-26 14:08:24 -04:00