We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7974c0c + 13190b1 commit b8a30c4Copy full SHA for b8a30c4
adafruit_usb_host_mouse.py
@@ -42,7 +42,7 @@
42
BUTTONS = ["left", "right", "middle"]
43
44
45
-def find_and_init_boot_mouse():
+def find_and_init_boot_mouse(cursor_image="/launcher_assets/mouse_cursor.bmp"):
46
"""
47
Scan for an attached boot mouse connected via USB host.
48
If one is found initialize an instance of BootMouse class
@@ -87,7 +87,9 @@ def find_and_init_boot_mouse():
87
mouse_device.set_configuration()
88
89
# load the mouse cursor bitmap
90
- mouse_bmp = OnDiskBitmap("/launcher_assets/mouse_cursor.bmp")
+ if not isinstance(cursor_image, str):
91
+ raise TypeError("cursor_image must be a string")
92
+ mouse_bmp = OnDiskBitmap(cursor_image)
93
94
# make the background pink pixels transparent
95
mouse_bmp.pixel_shader.make_transparent(0)
0 commit comments