December 01, 2022

On Thursday, 1 December 2022 at 21:34:41 UTC, Steven Schveighoffer wrote:

>

On 12/1/22 11:10 AM, ryuukk_ wrote:

>

Can you try with this page: https://www.raylib.com/examples/core/loader.html?name=core_input_gamepad

Does it detect your gamepad?

It should work because the IsGamepadAvailable function call is inside the loop. That's most certainly the problem with the OP code.

-Steve

That was the trick, inside the loop it detects the gamepad. No other changes needed.

December 01, 2022

On Thursday, 1 December 2022 at 15:35:37 UTC, Steven Schveighoffer wrote:

>

On 12/1/22 3:24 AM, bauss wrote:

>

But probably not on every frame, have a delay between checks.

It's not anything controllable by the user. The library does the check every frame regardless of whether you use it or not.

When you call the raylib function, you are not actually querying the device, you are checking a boolean in a struct.

https://github.com/raysan5/raylib/blob/387c06000618ef0aa3b15c5e46d1c525ba194c50/src/rcore.c#L3567

-Steve

Oh yeah then it's fine :)

December 01, 2022

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. No other changes needed.

I have a new problem:
Raylib-d can see all 6 gamepad axes. However, they all return 0 for all stick motion.

Do I need to initialize the gamepad somehow?

December 01, 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
December 05, 2022

On Friday, 2 December 2022 at 01:03:47 UTC, Steven Schveighoffer wrote:

>

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

Indeed, I plugged a different gamepad into the same system running the same code, and it worked. My gamepad must not have been on the list of gamepad input mappings used by SDL2 --> GLFW --> Raylib --> raylib-d.

1 2
Next ›   Last »