-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Currently, the default value of the cursor_image
parameter within adafruit_usb_host_mouse.find_and_init_boot_mouse
assumes that the application is running within Fruit Jam OS. To improve the usability of this library within other scenarios, the "mouse_cursor.bmp" should be included within this library and the find_and_init_boot_mouse
method should be able to automatically determine its absolute path.
In case the user doesn't actually want to use this library with displayio
, they should be able to disable the bitmap altogether and obtain x and y coordinates as a relative point from the initial position of the mouse without the use of a displayio.TileGrid
object.
Here is my proposed implementation of the cursor_image
parameter:
cursor_image="..."
, load the bitmap and generate theTileGrid
object as is currently implementedcursor_image=None
, determine the local bitmap file absolute path and continue normal operationcursor_image=False
, create theBootMouse
object without anydisplayio
initialization
The x and y position of the mouse could be access using basic checks, ie: return self.tilegrid.x if self.tilegrid else self._x
, or the position could be managed by class-level private variables regardless if a TileGrid
object was provided.
Note: Is there a limitation with circup libraries about distributing non-mpy files? Would it be possible to load bitmap data as a bytes
object instead?