File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Metro/Metro_RP2350_Minesweeper Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,22 @@ def update_ui():
138138 # set the mouse configuration so it can be used
139139 mouse .set_configuration ()
140140
141+ # Verify mouse works by reading from it
142+ buf = array .array ("b" , [0 ] * 4 )
143+ try :
144+ # Try to read some data with a short timeout
145+ data = mouse .read (0x81 , buf , timeout = 100 )
146+ print (f"Mouse test read successful: { data } bytes" )
147+ break
148+ except usb .core .USBTimeoutError :
149+ # Timeout is normal if mouse isn't moving
150+ print ("Mouse connected but not sending data (normal)" )
151+ break
152+ except Exception as e : # pylint: disable=broad-except
153+ print (f"Mouse test read failed: { e } " )
154+ # Continue to try next device or retry
155+ mouse = None
156+
141157buf = array .array ("b" , [0 ] * 4 )
142158waiting_for_release = False
143159left_button = right_button = False
You can’t perform that action at this time.
0 commit comments