Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put mouse before gamepad due to MacOS being finicky #4558

Merged
merged 1 commit into from
Apr 5, 2021

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
Member

@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