Skip to content

Mouse input does not work (is ignored) in MacOS #4532

@marcos-diaz

Description

@marcos-diaz

Setup

  • Firmware: CircuitPython 6.2.0 beta 3 (en_US)
  • Board: Raspberry Pi Pico
  • Host: Apple MacOS Big Sur 11.2.2 on MacBook Pro 2014

Reproduce

  1. Load this code as code.py
import time
import board
from digitalio import DigitalInOut, Pull
import usb_hid
from adafruit_hid.mouse import Mouse

button = DigitalInOut(board.GP16)
button.pull = Pull.DOWN
mouse = Mouse(usb_hid.devices)

while True:
    time.sleep(0.1)
    if button.value:
        print('CLICK!')
        mouse.click(Mouse.LEFT_BUTTON)
  1. Connect to host OS via USB cable.
  2. Push the button.

Expected results

  • Mouse clicks are performed on pushing the button.
  • It should work in any operative system.

Actual results

  • MacOS recognises there is a mouse (see below), but fails to perform a mouse click.
  • It does not work either in MacOS recovery mode (no user config).
  • Works as expected on Windows 10.
  • Works as expected on GNU/Linux.
  • Works as expected on PC BIOS.
  • No errors nor warnings are shown in the stdout.

Additional notes.

  • Mouse movement and wheel does not work either, with same results regarding OS' (it works in everything but MacOS).
  • Mouse usb_hid.device is present as expected with 0x01 page and 0x02 usage.
  • MacOS actually detects there is a mouse connected since the mouse config menu goes from this

to this

Screenshot 2021-03-07 at 10 32 15

when connected.

Thanks.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions