-
Notifications
You must be signed in to change notification settings - Fork 186
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
[Feature Request] Support Player LED support? #43
Comments
Just tried - and failed I was able to add the Player 1, Player 2, Player 3 and Player 4 LEDs as outputs to the report HID and then registered to listen for the callbacks, however Windows nor Android didn't seem to send those notifications. It still functions perfectly, but doesn't receive any events. Is it even supported in DirectInput? If someone more knowledgeable would like to troubleshoot it, I have included the modified library ESP32_BLE_GamepadPlayerLED.zip I wonder if @T-vK, or @wakwak-koba might be able to help If anyone does have a look, the GamepadOutputCallbacks.cpp file tries to output some logs |
@lemmingDev I don't think you failed ... I am not sure that the Player Feedback is a standard supported feature, same as haptic or force feedback. I believe that SDL2 add support by using HIDAPI services. My SDL generic branch, meant to Generic Controller, but that is very poorly chosen name, looks for the VID/PID of the ESP32 device and then I am going to look at the following functions in SDL2
If you are interested, I think the basic changes would be in https://github.com/LeeNX/SDL-mirror/blob/f58059d5e8847264bd8ee7a285a32ea998fbe4d9/src/joystick/hidapi/SDL_hidapi_generic.c Thou a simple python HID app that can send and receive I have not yet looked at the code yet ... Might be an idea to pop into a git branch and any updates could be tracked. Maybe also need a the correct HID Cap Thanks |
I probably won't spend any more time playing around with it as it's a non-critical feature. Good luck with it, and feel free to make pull requests if you get anything working |
DS4windows is able to control the LED color of an PS4 controller... maybe you can find there something that helps. ( https://github.com/Ryochan7/DS4Windows ) |
I don't know if this could help. But maybe the code for the CapsLock, NumLock, ScrollLock LEDs for keyboards can be adapted for the Gamepads: T-vK/ESP32-BLE-Keyboard#70 |
@T-vK that had been my train of thought. I think we have some progress, but now we need a way to test the LED support from the PC, but I don't think there is a standard support way to do, unlike keyboard LEDs, which I think is pretty standard. |
I think that Windows might support the Player Index number - https://docs.microsoft.com/en-us/windows/win32/api/xinput/nf-xinput-xinputgetstate and https://docs.microsoft.com/en-us/windows/win32/api/xinput/nf-xinput-xinputsetstate. @lemmingDev would this worth putting some time in? I am still working on adding support in SDL2, but it's pretty slow going form me. Think this is worth re-opening? Thou I am not sure how the HID would hook XInput ... Looks information still to find and understand. |
@LeeNX There's also an Arduino project that turns some boards with USB HID functionality into xinput controllers with LED and rumble functionality, but I wouldn't know where to start getting it working on the ESP32. |
Thanks @lemmingDev ... I was reading some more last night add see that XInput is meant for XBox360 Controllers and all other joysticks/gamepad type devices are normally connect via DirectInput. Basically XInput is Microsoft only or partner interface, not a standard nor open sourced. I was hoping there would be a supported or open standard to take advantage of. Thou Player Index (LED) just seemed like an easy step toward haptic and forcefeedback and seems to work for BLE Keyboard, but the OS is hooking into the CapLock/NumLock feedback. I am still trying to get HIDAPI working for me, so that I can build a few tests. Just so many layers and I don't think I remotely understand much of it or GLE GATT stuff, that is why your library is so super useful, thanks for that! |
@lemmingDev I was hoping we could possible re-open this feature request. I have been hacking away at getting some sort of feedback via BlueTooth back into the ESP32 over HID/GATT/HOG. I have not worked out all the details, but was finally able to get my test ESP32 and gamepad working, with me been able to write back. https://github.com/LeeNX/ESP32-BLE-Gamepad/tree/test-led I have shoehorned in a Usage PAGE LEDs and can get it reporting via the serial monitoring. I have made some notes, which can be seen at the end of the https://github.com/LeeNX/ESP32-BLE-Gamepad/tree/test-led#troubleshooting section. Going to see if I can get some feedback from the libSDL community. |
Please can we look at possible support some like Player ID LED Support, something like the PS3 LED
1 to 4
or the PS4 Colour bar?I have looked at this and my very basic C/BLE knowledge has me banging my head against a very hard brick wall ;-\
Some of my investigation with some suggests, like possible using the keyboard LED
none-support
- https://github.com/T-vK/ESP32-BLE-Keyboard/blob/928c09320e3e6e344a63640c7de21d52a20c1d47/KeyboardOutputCallbacks.cpp#L14.but I would not know how to use this ... Or I mean, I don't see how this hooks back into the code base, so I can connect LEDs to the reply, or turn this into a function to poll the LEDs as needed.
Making a branch for SDL2, with a Generic Controller, using HID over BLE, to setup Player ID - https://github.com/LeeNX/SDL-mirror/tree/generic
The text was updated successfully, but these errors were encountered: