-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix(windows): Add dynamic cursor fix (mousekeys) for KVM switches #4071
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
base: master
Are you sure you want to change the base?
fix(windows): Add dynamic cursor fix (mousekeys) for KVM switches #4071
Conversation
b674e9f
to
37fb41d
Compare
37fb41d
to
1b707b0
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4071 +/- ##
==========================================
- Coverage 11.31% 11.31% -0.01%
==========================================
Files 92 92
Lines 17571 17573 +2
Branches 8239 8239
==========================================
Hits 1989 1989
- Misses 14901 14903 +2
Partials 681 681
Flags with carried forward coverage won't be shown. Click here to find out more.
|
src/main.cpp
Outdated
{ | ||
// Check if devices change | ||
if (wParam == DBT_DEVNODES_CHANGED) { | ||
platf::check_and_force_cursor_visibility(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should only enable this behavior if we're actually streaming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, updated the PR to include a check is_streaming.
1b707b0
to
99407e1
Compare
…when stream doesn't detect a mouse.
99407e1
to
e3beac6
Compare
|
Description
This PR implements a dynamic fix that listens for the DBT_DEVNODES_CHANGED message.
It hooks into the WM_DEVICECHANGE window message in main.cpp. When triggered, it calls a new function, platf::check_and_force_cursor_visibility(), which safely checks if a mouse is present.
If no mouse is detected, it toggles the Windows "Mouse Keys" accessibility feature. This forces a system-wide cursor redraw, making the cursor visible on the stream again without affecting user settings.
This same function is now also used at stream startup to unify the cursor handling logic.
Screenshot
Issues Fixed or Closed
Type of Change
.github/...
)Checklist