Skip to content

Commit 916116c

Browse files
committed
Check first three interfaces for report mice
1 parent 39bca08 commit 916116c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

adafruit_usb_host_mouse/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ def find_and_init_report_mouse(cursor_image=DEFAULT_CURSOR): # noqa: PLR0912
181181
if mouse_device is not None:
182182
# detach the kernel driver if needed
183183
# Typically HID devices have interfaces 0,1,2
184-
# Trying 0..mouse_iface is safe and sufficient
185-
for intf in range(mouse_interface_index + 1):
184+
for intf in range(3):
186185
if mouse_device.is_kernel_driver_active(intf):
187186
mouse_was_attached = True
188187
mouse_device.detach_kernel_driver(intf)

0 commit comments

Comments
 (0)