mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-05-15 22:01:59 -06:00
[GH-ISSUE #36] Tracking issue for MacOS support #9
Labels
No labels
Xorg
documentation
enhancement
macos
pull-request
question
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/lan-mouse#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @feschber on GitHub (Nov 2, 2023).
Original GitHub issue: https://github.com/feschber/lan-mouse/issues/36
Tracking issue for MacOS support
This issue is for tracking MacOS support and the current development status.
TODOs
@feschber commented on GitHub (Dec 4, 2023):
#42
@feschber commented on GitHub (Dec 10, 2023):
Mouse input emulation works, for keyboard emulation the keycodes need to be translated.
@feschber commented on GitHub (Jan 25, 2024):
#81
@kiwiz commented on GitHub (Jan 28, 2024):
I took a quick look at Input Capture (I'm primarily interested in the ability to release input). It looks like
CGEventTapoffers the necessary functionality, but the interface is callback-based. There doesn't seem to be an easy way to marry that with the (polling-based)EventProducerparadigm in the code.@feschber commented on GitHub (Jan 29, 2024):
The easy way is to just spawn a thread. And as there doesn't seem to be any non-blocking systemcall for input capturing, this is probably the only way.
What I've been considering, is giving the producer access to the
sender_txchannel, which passes the events to theudp_task, directly.The event-consumer API does not have this problem, since the async consume() function can simply call synchronous code but considering that windows and macos both probably need a different thread for input capture, it might be good to do that at some point.
For now, if you want to work on this, I suggest you just spawn a thread and send the events via a
tokio::sync::mpsc::channelto the macos_producer.@rohitsangwan01 commented on GitHub (Apr 20, 2024):
@feschber really awesome project, just mac is missing, any plan or date to start work on Mac Input capture ?
i am working on a project which might depends on this project, so it would be really great to have Mac full support as well
@feschber commented on GitHub (Apr 20, 2024):
I can't give any estimate date but encryption and MacOS Input capture are next. Be aware the input capture API is a bit specific to this use case in that it locks the cursor and starts when the screen area is exited (this can not be done manually right now).
I was planning to extract this to a separate crate at some point for use in other projects.
@rohitsangwan01 commented on GitHub (Apr 20, 2024):
@feschber this implementation from Synergy might be helpful or inspiration for Mac support,
Also do you think it would be possible to use lan-mouse as a library for another project ?
@mkdalynn commented on GitHub (Apr 22, 2024):
Hello,
I'm trying to get this working but am having trouble. I have lan-mouse running on both machines (pop-os 22.04, and mac-os 13). I've added a client to both sides and see it's found the host, but the mouse wont move screens. Input is connected to the pop-os machine.
I'm not sure if I have something misconfiguration or if there is something else going on.
Happy to provide any other info.
@feschber commented on GitHub (Apr 22, 2024):
Be aware that Gnome < v45 won't work. I believe pop os does not ship gnome 45 yet so you're out of luck here unfortunately (until the next popos release)
Your log should show an error saying that only the dummy input capture is active.
@mkdalynn commented on GitHub (Apr 22, 2024):
Ah, I missed that dependency. Thanks for pointing it out.
@feschber commented on GitHub (Apr 23, 2024):
Yeah it might be a good idea to add a hint to the ui as well since this is not entirely obvious.
@feschber commented on GitHub (Apr 23, 2024):
Also do you think it would be possible to use lan-mouse as a library for another project ?
As I said, I am planning to separate the input emulation and capture into separate crates. There are a few limitations (by design):
lan-mouseuses scancodes for keyevents. To use them for textinput an additional library is required to translate them to text (and the other way). Probably xkbcommon. But this is out of scope of this project.layer-shellbackend is designed (it simply spawns an invisible layershell surface).Eventtype used internally could use some improvements as it is currently tied pretty closely to the rest oflan-mouse.So yeah depending on the project it could certainly be used as a library.
@rohitsangwan01 commented on GitHub (Apr 23, 2024):
@feschber ohh that would be great,
Not sure if this is the correct place to describe, Am working on Similar implementation but with Android and IOS and got some success as well, which expands Apple's universal control functionality to Android and IOS as well, here is a demo of older version of this software
but my plan is to build a proper cross platform or atleast support LanMouse as server, if there are any documentation of protocols to implement a third party client app for lanMouse, and if you will split in different crates, then it would be really easy to integrate lanMouse support in Flutter with flutter_rust_bridge
@feschber commented on GitHub (Apr 23, 2024):
Interesting! I did a prototype android app before (only for Android input capture, not emulation) and it worked quite well.
The network protocol I'm currently using is a custom one and bound to change. Because of that it is also not yet documented.
If you want something to work with, heres a brief overview:
The types are encoded as two bytes - one for the event type (pointer / keyboard, etc.) and one for the event sub-type (e.g. motion / button).
The rest of the data depends on the specific event sub-type.
You can check out https://github.com/feschber/lan-mouse/blob/main/src/event.rs for the current implementation.
It is basically just a type-length-value (TLV) protocol with the length omitted.
Admittedly its a bit ugly at the moment but I plan to rework it anyway so dont spend too much time on it.
In the future, I want to include variable length integer encoding for bandwidth savings and remove some redundant data I was not sure is needed when I started out.
There is also some Event types that are still missing (notably touch input and high precision scroll events but maybe also gamepad events at some point).
@rohitsangwan01 commented on GitHub (Apr 23, 2024):
i see, ok i guess it would be better to invest client integration time after refactoring or atleast initial documentation when protocols will be stable, Thanks for the detailed info
@feschber commented on GitHub (May 14, 2024):
#131
@isleshocky77 commented on GitHub (Sep 9, 2024):
I don't want to make a new issue if this is already known; however, it also may be related to #91 . I'm able to move from the server (Ubuntu 24.04) to the client (mac os); however, I'm unable to double-click the mouse on the client's screen.
Everything else seems to be working so far (minus the ability to come back without using the keyboard shortcuts).
@livexia commented on GitHub (Sep 11, 2024):
There is a problem when I test with two mac, I found that shift won't work while using another machine's keyboard.
shift + minput justmnotM@feschber commented on GitHub (Nov 9, 2024):
@livexia this should now be fixed. Would be nice, if you can confirm!
@livexia commented on GitHub (Nov 9, 2024):
using git repo version, install with cargo build --release, run with cargo run --release. I can connect mac to linux, both can control each other. I current only have one mac, so I can not verify two mac connection. With one linux and one mac, using mac keyboard on linux shift + m still only m not M, and scroll direction is still invert. I also find that it's smooth connect macos from linux, with other way around the mouse is a bit inconsistent.
@bdols commented on GitHub (Nov 17, 2024):
I've built the latest commit on Fedora and Mac, with linux connecting to a remote mac.
Am I supposed to add the fingerprint for every connection on both sides?
When I did not add the incoming connection's fingerprint, I only saw this error and had no indication that I might need to add another fingerprint:
I also see that the mouse scrolling is inverted for the remote to the mac, and things like double-clicking to highlight selection by word does not work on the remote.
on the linux side, I see this warning, not sure if it's necessary:
2024-11-17T00:21:32Z WARN input_emulation] wlroots backend:
wayland protocol "wlr-virtual-pointer-unstable-v1" not supported: the requested global was not found in the registrybut it's functional, I'm going to try to run this for a week
@livexia commented on GitHub (Nov 17, 2024):
I have using this for past few days, I play factorio on mac and reading docs or blueprint on linux tablet. Even with problems, I think it's working ok. I also uisng a config file to avoid everytime config fingerprints.
@livexia commented on GitHub (Nov 18, 2024):
I think there is a problem with stuck key, sometimes one key will stuck, even after disconnect.
logs: keyA is stuck
@bdols commented on GitHub (Nov 18, 2024):
I also have seen a stuck key issue once and I have seen 2-3 times where both sides disconnect and reconnect after about 1 second. I'm using the keyboard remotely and it's perhaps more noticeable for me.
Other than that, I have not had issues with repeat key events (i.e. holding down one of the arrow keys) which is good.
two surprises: 1) I usually can horizontally scroll by holding the left shift key while moving the scroll wheel up/down on my mouse, but that's not working. 2) My linux desktop with K+M will try to lock itself while I'm connected remotely, I don't recall if that's expected behavior that similar software also exhibits. I had one issue where i had to restart both lan-mouse instances after unlocking it to get it working again -- could be a wayland issue that I was having.
@grodius commented on GitHub (Sep 24, 2025):
Hi - I'm running lan-mouse as an .app in mac now, and though I can manually approve the linux host and control the mac fully, my client never saves the approved fingerprint.
I've added the fingerprint manually to .config/lan-mouse/config.toml as:
[authorized_fingerprints]
"key" = "hostname"
and just for good measure did a chmod -R 777 on .config/lan-mouse and launched the app in terminal as sudo, but the config is never pre-populated or remembered when relaunching Lan Mouse. Does the .app pull the config from another location or something?
@feschber commented on GitHub (Oct 31, 2025):
@grodius saving functionality is coming soon :) #345
@Revoxandco commented on GitHub (Nov 21, 2025):
@grodius it is working for me in ~/.config/lan-mouse/config.toml on my mac arm with the correct key and hostname
@Revoxandco commented on GitHub (Nov 21, 2025):
I have a problem with an arch + hyprland host and a Macos client, I can't disable natural scrolling and it is correctly disabled on the client, with a physical mouse the option is disabled and it scrolls correctly
@feschber commented on GitHub (Nov 24, 2025):
@Revoxandco #347 will let you configure this. I'm also looking into reading the user configuration from MacOS Settings.
@Revoxandco commented on GitHub (Dec 1, 2025):
Okay, I didn't understand why it was not working since I was using lan-mouse-git from AUR, it is not updated. I will install it manually
@elondres-mim commented on GitHub (Apr 15, 2026):
general question, is it expected that ctrl + arrow keys workspace switching should work? I'm trying to figure out if I've got a config problem, or Lan Mouse just doesn't support that
@feschber commented on GitHub (Apr 16, 2026):
Known issue. Havent figured that one out yet...