bsiever / microbit-pxt-blehid

Micro:bit MakeCode support to act as a Human Interface Devices (keyboard, mouse, etc.) over Bluetooth
https://bsiever.github.io/microbit-pxt-blehid/
MIT License
30 stars 10 forks source link

Test / Revise Gamepad #19

Closed bsiever closed 2 years ago

bsiever commented 2 years ago

May want to compare with Teensy Joystick (different usage page): https://github.com/PaulStoffregen/cores/blob/02b18c609abebb4b3565a9d4b8db43f3433c6f78/usb_hid/usb.c#L172

send_now(): https://github.com/PaulStoffregen/cores/blob/02b18c609abebb4b3565a9d4b8db43f3433c6f78/usb_hid/usb_api.cpp#L629

Init: https://github.com/PaulStoffregen/cores/blob/02b18c609abebb4b3565a9d4b8db43f3433c6f78/usb_hid/usb.c#L545

Report methods: https://github.com/PaulStoffregen/cores/blob/02b18c609abebb4b3565a9d4b8db43f3433c6f78/usb_hid/usb_api.h#L89

bsiever commented 2 years ago

PJRC/Teensy has some good details on how their HID descriptor maps to a joystick: https://www.pjrc.com/teensy/td_joystick.html

bsiever commented 2 years ago

Virtual Gamepad emulation framework: https://vigem.org/

Unity's level of HID support: https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/HID.html

bsiever commented 2 years ago

Maybe: https://github.com/NicoHood/HID/blob/master/src/SingleReport/SingleGamepad.cpp

bsiever commented 2 years ago

I've tried several variations (joystick vs. Gampad variations). Joystick (based on Teensy) didn't seem to be recognized correctly on most platforms. Reverted and holding with this report for now. May want to reconsider having internal state.

bsiever commented 2 years ago

https://github.com/FeralAI/MPG