Skip to content

Conversation

@dnakov
Copy link

@dnakov dnakov commented Oct 8, 2025

Adds bidirectional clipboard sharing between all connected machines.
Clipboard sharing is enabled by default. To disable, add to ~/.config/lan-mouse/config.toml:
enable_clipboard = false

4KB max, no chunking, text only

@dnakov dnakov force-pushed the clipboard-sharing branch 2 times, most recently from 25c7348 to 2348274 Compare October 8, 2025 18:59
@dnakov dnakov force-pushed the clipboard-sharing branch 2 times, most recently from 4fcfae0 to d544e9c Compare October 12, 2025 20:09
@feschber feschber force-pushed the clipboard-sharing branch 2 times, most recently from 43627e8 to 9fbce5e Compare October 18, 2025 09:59
@feschber
Copy link
Owner

feschber commented Oct 18, 2025

A few things - we dont have to fix any of this right away:

  • I'm not a fan of polling the clipboard. This seems a bit wasteful and it seems like there should be a better way? How do clipboard monitoring tools do it?
    Maybe, it would make sense to get the clipboard contents upon entering a client device? This would of course not synchronize the clipboard when copied though.

  • It might be worth having ClipboardEvent be a direct member of the input_capture::CaptureEvent enum instead of input_event::Event and split input_event::Event into input_event::{InputEvent,ClipboardUpdate} or something. This way we could drop the dummy implementations on all of the input_emulation backends that do not support clipboard sharing.

  • I would prefer to keep clipboard_monitor and clipboard_emulation out of the service struct and instead move them into the lan_mouse::emulation::Emulation / lan_mouse::capture::Capture structs respectively.
    We should not need a ClipboardReceived Event on the emulation side and could instead handle it like any other emulation event.
    ClipboardReceivedEvents coming from the input capture / connection via ICaptureEvent could then be send to the emulation via an additional function lan_mouse::emulation::Emulation::update_clipboard() and EmulationRequest::UpdateClipboard(ClipBoardEvent) in lan_mouse::emulation instead of being handled directly in the service.

Let me know your thoughts!

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.

2 participants