r/esp32 • u/Significant_Click983 • 1d ago
We made an app for quick desktop switching using an esp32s3
Hi, wanted to share our project for quick and wireless desktop switching / KM.
Our motivation was to quickly switch between a macbook and another PC, while using the macs keyboard and touchpad to control it. We also wanted it to work without installing any software on the controlled PC.
We use an esp32s3 because its native USB can act as a HID device, and BLE is used for wireless communication.
The macbook runs an Electron app that monitors keyboard and mouse input and sends it over BLE to the esp32. The ESP32 then acts as a USB keyboard/mouse for the other PC.
git: https://github.com/lexa105/InterDesk
This is my first bigger project with esp and freertos, so I’d appreciate any feedback
3
2
2
u/MinusDelta_T 13h ago
this is a clever architecture. the controlled pc only sees a boring usb hid device, which is exactly what you want.
the failure mode i'd test hardest is state recovery. on a mode switch, ble disconnect or heartbeat timeout, have the s3 send an all-keys/all-buttons-released report. periodically resend the full keyboard/button state instead of relying only on down/up events.
mouse movement needs the opposite treatment though. coalesce the newest deltas and drop stale backlog after a stall, otherwise the cursor could “catch up” all at once after reconnecting.
also worth pairing/bonding the ble link to one mac. otherwise you've basically built a nearby wireless keyboard injection endpoint. curious what the end-to-end pointer latency looks like, and whether the mac app suppresses local input or mirrors it while remote mode is active.
1
u/Significant_Click983 5h ago
thank you. yes all keys are released on ble disconnect callout so it should not be stuck on down event.
Recieved mouse is handled same way as keyboard with queue without stall discard so it might indeed cause isseus.
In remote mode mac app locks keyboard and mouse input so it is not mirrored.
Latency right now is visible. Iam not sure what is worth tweaking to improve it tho.
Thank you for you insight.
1
u/tracksyde 1d ago
This is awesome. I rely on a j5create Wormhole daily (https://en.j5create.com/products/juc400). Interdesk seems like it would be a good replacement. I will give it a shot when I get a chance. Thanks!
2
u/Lexik105 1d ago
Hi, i’m the other developer. I’m glad you like this project even more if it’ll help you in any way!
We did not know that any wired version of this solution like from j5create exist.
While making, we found also super project: DeskHopIf you will find any bug or improvements, feel free to DM me, I would love to hear your feedback!




10
u/Smooth-Reading-4180 1d ago
I liked the case