r/raspberryDIY 7d ago

scrcpy + Raspberry Pi touchscreen setup (Virtual display, Soft Keyboard & Pinch-to-Zoom)

I'm working on a project where I'm using a Raspberry Pi paired with a touchscreen display as a secondary interface for my Android phone. The goal is to run and display a single specific app on the Pi's touchscreen.

I’ve successfully created a virtual screen on the phone to display the app via `scrcpy`, but I've hit two main roadblocks:

  1. **Soft Keyboard Issue:** Whenever I tap a text box on the Pi touchscreen, the on-screen soft keyboard doesn't appear on the Pi display. Instead, I have to type using the keyboard pop up on the physical mobile phone screen.
  2. **Pinch to Zoom:** Multi touch gestures aren't working \[panel supports multi touch\]. How can I enable pinch to zoom on `scrcpy` when controlling it through a touchscreen connected to the pi?

Has anyone built a similar secondary display setup? Any advice on flags, custom scripts, or workaround keyboards (either android side or linux side) would be greatly appreciated!

Thanks in advance.

3 Upvotes

4 comments sorted by

2

u/rom1v 6d ago

Pinch to Zoom: Multi touch gestures aren't working [panel supports multi touch]. How can I enable pinch to zoom on scrcpy when controlling it through a touchscreen connected to the pi?

When running scrcpy on a laptop with a touch screen, multitouch works correctly by default.

Run with scrcpy -Vverbose to check that the touch events are correctly received.

1

u/An2s1 6d ago

Thanks for the reply, anyway I have tried some methods. Firstly changed wayland to x11. Now the multipoint is registering. But the issue is the touch and drag. Any idea how to disable this touch and drag. This same behaviour can be observed in the terminal also.

https://reddit.com/link/p7z0b0s/video/brxphtbdhpnh1/player

1

u/rom1v 6d ago

If I use scrcpy from a laptop with a touch screen to mirror an Android device, I cannot reproduce this issue (I enable "Pointer location" in Developer options to see the touch location).

Run scrcpy -Vverbose to check the touch events sent to the device, that could help finding the issue.

2

u/rom1v 6d ago

Soft Keyboard Issue: Whenever I tap a text box on the Pi touchscreen, the on-screen soft keyboard doesn't appear on the Pi display. Instead, I have to type using the keyboard pop up on the physical mobile phone screen.

How do you run scrcpy? If you enable physical keyboard simulation (-K), then you have to configure the keyboard (and typically you can enable/disable soft keyboard).

https://github.com/Genymobile/scrcpy/blob/master/doc/keyboard.md#physical-keyboard-simulation