-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
do not allow using keyboards and mice as HID controllers #4243
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,16 @@ | |
namespace { | ||
|
||
bool recognizeDevice(const hid_device_info& device_info) { | ||
// Skip mice and keyboards. Users can accidentally disable their mouse | ||
// and/or keyboard by enabling them as HID controllers in Mixxx. | ||
// https://bugs.launchpad.net/mixxx/+bug/1940599 | ||
if (device_info.usage_page == kGenericDesktopUsagePage && | ||
(device_info.usage == kGenericDesktopMouseUsage || | ||
device_info.usage == kGenericDesktopKeyboardUsage)) { | ||
return false; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we move this to the default deny list instead? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried that at first but the backwards logic made it really confusing. I think this implementation is more straightforward. First there is this check for all mice and keyboards, then the denlylist is used to filter specific device models. |
||
|
||
// Exclude specific devices from the denylist. | ||
bool interface_number_valid = device_info.interface_number != -1; | ||
const int denylist_len = sizeof(hid_denylisted) / sizeof(hid_denylisted[0]); | ||
for (int bl_index = 0; bl_index < denylist_len; bl_index++) { | ||
|
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.
This change seem to be unrelated.
Now it runs to the default branch which is less describtive.
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.
These devices do not appear in the GUI because they are filtered out in HidEnumerator.