Skip to content

tools/pbl: add QEMU touch injection (touch/swipe)#1790

Open
vvzvlad wants to merge 1 commit into
coredevices:mainfrom
vvzvlad:pbl-qemu-touch
Open

tools/pbl: add QEMU touch injection (touch/swipe)#1790
vvzvlad wants to merge 1 commit into
coredevices:mainfrom
vvzvlad:pbl-qemu-touch

Conversation

@vvzvlad

@vvzvlad vvzvlad commented Jul 23, 2026

Copy link
Copy Markdown

While developing touch navigation I needed a way to drive the touchscreen
under QEMU to iterate and test without flashing hardware, so I wrote this.

./pbl qemu now exposes a QMP socket, and two commands inject touch into a
running emulator:

./pbl touch 130 130
./pbl swipe 130 220 130 40 [--steps N --duration S]

Coordinates are screen pixels; the display size is read from the emulated
pebble-touch device and scaled to QEMU's absolute-axis range. Swipes stream
intermediate moves so drag gestures are seen as continuous. Injection uses the
absolute-pointer input path (input-send-event abs+btn); multi-touch is not
wired up in the device.

Also documents the workflow in the working-with-qemu skill.

Tested on qemu_gabbro: ./pbl qemu creates the QMP socket; touch and swipe
land at the expected coordinates (verified against the pebble-touch device
registers).

@vvzvlad
vvzvlad requested review from gmarull and jplexer as code owners July 23, 2026 01:36
Developing touch navigation needed a way to drive the touchscreen under QEMU
without flashing hardware, so `./pbl qemu` now exposes a QMP socket and two
new commands inject touch events into a running emulator:

  ./pbl touch X Y              tap at a pixel coordinate
  ./pbl swipe X1 Y1 X2 Y2      swipe, streaming intermediate moves so drag
                               gestures are seen as continuous

Coordinates are in screen pixels; the display size is read from the emulated
pebble-touch device and scaled to QEMU's absolute-axis range. Injection uses
the absolute-pointer input path (input-send-event abs+btn); multi-touch is not
wired up in the device.

Document the commands in docs/development/qemu.md and the working-with-qemu
skill.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Vlad Zaytsev <git@vvzvlad.xyz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant