Skip to content

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Apr 4, 2021

Fixes #4479.

The HID devices were reordered after 6.2.0-beta.2 or so, and ended up being alphabetical. This put MOUSE last, which MacOS did not like. Reordering to KEYBOARD MOUSE ... GAMEPAD ... fixed the problem.

Tested on CPX because it was convenient:

import time

import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
from adafruit_hid.mouse import Mouse

from adafruit_circuitplayground import cp

keyboard = Keyboard(usb_hid.devices)
mouse = Mouse(usb_hid.devices)

while True:
    if cp.button_a:
        keyboard.send(Keycode.A)
    if cp.button_b:
        mouse.move(50, 50)
    time.sleep(1)

@dhalbert dhalbert requested review from jepler and tannewt April 4, 2021 18:12
Copy link

@jepler jepler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't test on mac, but it appears to do what it says.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants