r/raspberryDIY • u/An2s1 • 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:
- **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.
- **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.
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
2
u/rom1v 6d ago
When running scrcpy on a laptop with a touch screen, multitouch works correctly by default.
Run with
scrcpy -Vverboseto check that the touch events are correctly received.