raylib-d Gamepad Detection Fails

Steven Schveighoffer schveiguy at gmail.com
Fri Dec 2 01:03:47 UTC 2022


On 12/1/22 5:50 PM, jwatson-CO-edu wrote:
> On Thursday, 1 December 2022 at 22:16:30 UTC, jwatson-CO-edu wrote:
>> That was the trick, [inside the loop it detects the 
>> gamepad](https://github.com/jwatson-CO-edu/nanoverse/blob/main/d/raylib/04_jsInput/source/app.d#L35).  No other changes needed.
> 
> I have a new problem:
> Raylib-d [can see all 6 gamepad 
> axes](https://github.com/jwatson-CO-edu/nanoverse/blob/main/d/raylib/04_jsInput/source/app.d#L44).  However, they [all return 0](https://github.com/jwatson-CO-edu/nanoverse/blob/main/d/raylib/04_jsInput/source/app.d#L48) for all stick motion.
> 
> Do I need to initialize the gamepad somehow?
> 

Looking at the example posted by ryuukk, you shouldn't have to.

Does it detect the buttons? Does your gamepad actually have analog 
sticks? Do all 6 axes show no movement?

I don't see anything inherently wrong with your code. I also don't have 
a gamepad to try with, plus even if I did, it's possible my setup would 
work while yours doesn't.

It's important to remember that raylib-d doesn't do any special things 
with the raylib functions -- they are just straight calls into the library.

-Steve


More information about the Digitalmars-d-learn mailing list