File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 3
3
4
4
import supervisor
5
5
from displayio import Group , Palette , TileGrid
6
- import terminalio
7
6
from adafruit_display_text .bitmap_label import Label
8
7
from adafruit_editor import editor , picker
9
8
from tilepalettemapper import TilePaletteMapper
10
9
from adafruit_argv_file import read_argv , write_argv
11
10
from adafruit_fruitjam .peripherals import request_display_config
12
11
from adafruit_usb_host_mouse import find_and_init_boot_mouse
12
+ import terminalio
13
+ import usb
13
14
14
15
print (f"cwd in editor/code.py: { os .getcwd ()} " )
15
16
25
26
font_palette [0 ] = 0x000000
26
27
font_palette [1 ] = 0xFFFFFF
27
28
28
-
29
29
font = terminalio .FONT
30
30
char_size = font .get_bounding_box ()
31
31
screen_size = (display .width // char_size [0 ], display .height // char_size [1 ])
62
62
else :
63
63
file = picker .pick_file (terminal )
64
64
65
- mouse = find_and_init_boot_mouse ()
65
+ usb_device_count = 0
66
+ for dev in usb .core .find (find_all = True ):
67
+ usb_device_count += 1
68
+
69
+ mouse = None
70
+ if usb_device_count > 1 :
71
+ mouse = find_and_init_boot_mouse ()
72
+
66
73
if mouse is not None :
67
74
mouse .x = display .width - 6
68
75
main_group .append (mouse .tilegrid )
You can’t perform that action at this time.
0 commit comments