lindbergh-loader icon indicating copy to clipboard operation
lindbergh-loader copied to clipboard

add sdl2 controller support

Open dmanlfc opened this issue 11 months ago • 12 comments

allows someone to grab an xbox or playstation style controller for lindbergh

  • best for driving & fighting games
  • shooting games are still better with a mouse or lightgun using evdev

dmanlfc avatar Jan 12 '25 08:01 dmanlfc

That is a good idea. I would also suggest to document on how to get this stared, like how to configure on a config file, etc.

jcchikikomori avatar Jan 16 '25 10:01 jcchikikomori

That is a good idea. I would also suggest to document on how to get this stared, like how to configure on a config file, etc.

There is no configuration required. It's plug in a gamepad & play. As long as the controller is supported under SDL2, there should be no issues.

dmanlfc avatar Jan 24 '25 06:01 dmanlfc

Would it be possible to add the key name instead of just the code? Like SDLK_A?

dkeruza-neo avatar Jan 24 '25 13:01 dkeruza-neo

Would it be possible to add the key name instead of just the code? Like SDLK_A?

For what? SDL keys are already implemented and are self explanatory.

dmanlfc avatar Jan 24 '25 22:01 dmanlfc

For a cleaner code.

dkeruza-neo avatar Jan 24 '25 23:01 dkeruza-neo

Would it be possible to add the key name instead of just the code? Like SDLK_A?

For what? SDL keys are already implemented and are self explanatory.

Nevermaind, I was looking at a different part of the code.

dkeruza-neo avatar Jan 25 '25 01:01 dkeruza-neo

Sorry I've been slow here, it is on my radar to merge in!

bobbydilley avatar Jan 28 '25 08:01 bobbydilley

Thank you so much for this work, it looks really good - I'm happy to merge with one small consideration:

Running evdev + SDL controllers at the same time will cause issues which is the default currently. I quite liked when you could use evdev for controllers, but still have SDL available for keyboard presses so you didn't have to map absolutely everything - I wonder if we should change the INPUT_MODE selector to be?

  1. SDL Keyboard/Mouse + SDL Controllers
  2. SDL Keyboard/Mouse + EVDEV Controllers
  3. Just EVDEV Controllers

With 0 still being the default.

What do we think?

bobbydilley avatar Jan 28 '25 10:01 bobbydilley

@bobbydilley rebased to Master & updated the input modes as per your suggestions.

dmanlfc avatar Jan 29 '25 10:01 dmanlfc

That is a good idea. I would also suggest to document on how to get this stared, like how to configure on a config file, etc.

There is no configuration required. It's plug in a gamepad & play. As long as the controller is supported under SDL2, there should be no issues.

I forgot to include the context on why i said this one before. I had issues on my Steam Deck, even i tried to disable the Steam Input. I was building the loader using distrobox, then tried to run it (still under distrobox).

Running evdev + SDL controllers at the same time will cause issues which is the default currently. I quite liked when you could use evdev for controllers, but still have SDL available for keyboard presses so you didn't have to map absolutely everything - I wonder if we should change the INPUT_MODE selector to be?

This might be the cause, but i don't have enough evidence to support.

jcchikikomori avatar Feb 17 '25 05:02 jcchikikomori

I was reviewing the code. In glxhooks.c you added pollEvents(); to the function glXSwapBuffers. Adding that, setting the games to not use SDL, will use X11 input and SDL input at the same time. I am not sure about that. I also know that function needs to be cleaned up.

dkeruza-neo avatar Mar 31 '25 14:03 dkeruza-neo

It is required for games that use glx and has no conflicts with X11 input.

dmanlfc avatar Mar 31 '25 20:03 dmanlfc