New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mid-session unplug/replug events sometimes cause LinearMouse to not work properly. #48
Comments
Hi @jiroumu, Thank you for submitting this!
Do you mean that when you plug your mouse, the cursor acceleration and sensitivity aren't updated correctly? That's possible. LinearMouse scans mice and adjusts their cursor acceleration and sensitivity every 5 seconds. So if you move your mouse right after plugging it in, LinearMouse may not have updated its cursor settings. When I get time, I'll improve this. However, everything should works fine in 5 seconds without replugging the mouse. Could you please verify this? |
I have had similar issues before where LinearMouse would not apply acceleration and sensitivity correctly before replugging the usb receiver of my mouse. Restarting LinearMouse or waiting did not solve the issue. Only replugging did. Sadly i don't know how to reproduce this behavior reliably yet and it occurred only very sporadically. This might have to do with my Thunderbolt Dock though, as my USB audio interface is also sometimes reset to full volume after waking my MacBook connected to the Dock. |
Thank you, @collinkreutzer! I'm trying to reproduce this issue. If someone has reproduced it, the logs might assist me in determining what's going on. |
That's correct. For me, the issue only occurs when I unplug my mouse and replug it, then sometimes it won't be updated correctly, but it's hard to actually reproduce consistently.
I was trying just now as per your instructions regarding the console. Will update when I've been successful in reproducing the issue or catching misbehavior in the console. |
I've optimized the code. LinearMouse now receives notifications of device additions and removals. After plugging in USB receivers, cursor acceleration and sensitivity will be applied immediately. You may try the binary here. I'm not sure if this issue has been fixed as I couldn't reproduce it. If it still exists in this version, please let me know. Thank you! |
Your efforts are much appreciated. I've installed and will report back with my findings. Cheers. |
Alright, I managed to reproduce the issue on the newest version. See the attached screenshot of the Console log. The log starts in a state where I just plug-cycled the mouse and LinearMouse wouldn't update sensitivity/acceleration due to it mistaking the mouse as a trackpad. After unplugging and replugging again, everything goes back to working as expected again, as can be seen in the later half of the log. |
@jiroumu Thank you very much for the screenshot! It seems that there are two devices named “Orochi V2”, one is treated as a mouse and the other a trackpad. It could be possible, I think, though my USB receiver registers only one mouse device. Could you please check the log when everything works as expected? I couldn't see the log after the two “Orochi V2” are detected. |
Thank you for providing this helpful information! At least, I know that both “Orochi V2” are expected to be mice. It's odd that one of the “Orochi V2” service sometimes doesn't contain the mouse acceleration value by which LinearMouse detects trackpads: linearmouse/LinearMouse/CursorManager.swift Lines 99 to 102 in aa29cd7
I'll experiment with changing the method LinearMouse identifies trackpads to see whether it works in this case. Perhaps I should create a user interface for debugging as well. |
I've rework the mouse detection algorithm in #82. Would you like to try this build and see if this issue still exists? |
Thanks for still taking the time. To be honest, for whatever reason the issue hasn't reoccured for me for the last month or so. Not sure if it's connected to a macOS update or something else you've been doing/adding since then (I keep LinearMouse up to date via brew). So I'm not sure if I'd even be able to verify the proposed fix in your new build as of now :o |
I guess the credit should be given to macOS updates. Anyway, I'm glad you got rid of the problem :) I'm closing this issue. Feel free to reopen it anytime if you need additional help. |
Hey lujjjh,
first of all I'd like to thank you for the great work you've been doing with LinearMouse, it has been a treat so far.
During a session LinearMouse starts working fine after sign-on. When I unplug and later replug my mouse (I use a USB-switch to use the same mouse between computers, effectively constituting a plug-cycle as far as I can tell), LinearMouse will sometimes not function properly and won't apply the set preferences. Plug-cycling the mouse again sometimes brings function back. When it works, it keeps working without intermittent failure, only plug-cycling triggers it.
I've found that when plug-cycling and NOT touching the mouse for a few seconds until I'm sure the device switch is completed, LinearMouse again tends to work more often than not. When moving the mouse during a plug-cycle, LinearMouse seems to work less often coming back. Might just be my imagination, though.
The text was updated successfully, but these errors were encountered: