Skip to content

Commit

Permalink
Merge pull request mixxxdj#11324 from acolombier/bugfix/touchscreen-d…
Browse files Browse the repository at this point in the history
…etected-as-controller

Excluding HID devices of Finger and Touch screen usage table
and two specific devices by VID/PID
  • Loading branch information
JoergAtGithub authored Mar 25, 2023
2 parents 0e7601c + 9a226b8 commit 0ac86c0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
10 changes: 8 additions & 2 deletions src/controllers/hid/hiddenylist.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ typedef struct hid_denylist {

/// USB HID device that should not be recognized as controllers
hid_denylist_t hid_denylisted[] = {
{0x1157, 0x300, 0x1, 0x2, -1}, // EKS Otus mouse pad (OS/X,windows)
{0x1157, 0x300, 0x0, 0x0, 0x3}, // EKS Otus mouse pad (linux)
{0x1157, 0x300, 0x1, 0x2, -1}, // EKS Otus mouse pad (OS/X,windows)
{0x1157, 0x300, 0x0, 0x0, 0x3}, // EKS Otus mouse pad (linux)
{0x04f3, 0x2d26, 0x0, 0x0, -1}, // ELAN2D26:00 Touch screen
{0x046d, 0xc539, 0x0, 0x0, -1}, // Logitech G Pro Wireless
// The following rules have been created using the official USB HID page
// spec as specified at https://usb.org/sites/default/files/hut1_4.pdf
{0x0, 0x0, 0x0D, 0x04, -1}, // Touch Screen
{0x0, 0x0, 0x0D, 0x22, -1}, // Finger
};
8 changes: 4 additions & 4 deletions src/controllers/hid/hidenumerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ bool recognizeDevice(const hid_device_info& device_info) {
const int denylist_len = sizeof(hid_denylisted) / sizeof(hid_denylisted[0]);
for (int bl_index = 0; bl_index < denylist_len; bl_index++) {
hid_denylist_t denylisted = hid_denylisted[bl_index];
// If vendor ids do not match, skip.
if (device_info.vendor_id != denylisted.vendor_id) {
// If vendor ids are specified and do not match, skip.
if (denylisted.vendor_id && device_info.vendor_id != denylisted.vendor_id) {
continue;
}
// If product IDs do not match, skip.
if (device_info.product_id != denylisted.product_id) {
// If product IDs are specified and do not match, skip.
if (denylisted.product_id && device_info.product_id != denylisted.product_id) {
continue;
}
// Denylist entry based on interface number
Expand Down

0 comments on commit 0ac86c0

Please sign in to comment.