-
Notifications
You must be signed in to change notification settings - Fork 204
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
Cannot move craft with Joystick #26
Comments
In my case, the controller still works as before - unless I customize controls in the new menu. Any button I change in controller settings doesn't work (on new button or old). The movement still works as I didn't change that. If I delete the save.dat contoller works (with default buttons) again. Also during the controller setup, it doesn't recognize my right shoulder button at all. Seems to recognize everything else. I'm using cheap usb gamepad (Mafiti GP100). |
Yeah, the Analog Stick is not bound by default anymore, but you should be able to bind it again in the options -> controls.
To clarify: you're able to set the buttons in the options but then cannot use them in the game? |
I realize now my issue is unrelated to the thread topic, as I'm not using a joystick, only dpad.
Yes, but I figured out if I restart the game after making button changes, then they work as expected. The only issue I dunno how to work around is why it ignores my right shoulder, but there's enough other buttons I'm okay without it anyway. Thanks again for great job, gameplay is great. |
Ah, meh. I thought I had fixed that issue. I believe it's caused by the buttons states not set correctly when a new button is bound. I'll look into it.
The mapping in platform_sdl.c is missing some that I (falsely?) assumed to be mostly unused. SDL provides these buttons: https://wiki.libsdl.org/SDL2/SDL_GameControllerButton – I guess the shoulder button on your gamepad is one of the Can you maybe add a |
Did it, and I see output in the terminal for other buttons similar to: It does work in other sdl2 games and identifies it as button5, for example dolphin emulator: |
Button 5 is (not sure what I was thinking there; I guess we should also use the SDL names for these buttons. I believe the internal names where initially from an old game controller in the browser test of mine...) If it doesn't work: the It should be right here
Edit: maybe this program can also provide some clarity: https://github.com/Grumbel/sdl-jstest |
I updated and modified file again. Now for buttons that work, it just outputs stuff like "button 0". But still nothing for the right shoulder. That tool works, and when I run sdl2-jstest --test 0, and press right shoulder, button 5 gets #, and all other buttons work too (except 6&7 which I dont actually have, that test reports 10 buttons but its really only dpad + 8 buttons).
|
Well, now I'm a bit confused. When you launch Does the button work when testing gamepad events? |
Why is there two APIs? Ancient history the joystick api came first as part of alsa. The event api came later as part of the kernel. https://docs.kernel.org/input/input_uapi.html for all the gory details. Its what sdl2 uses under the hood on linux. |
Ok, I previously thought that maybe this button would only work through the joystick API. Now I'm wondering how in the hell this button is not registered in the code here. One last thing: sdl2-jstest uses polling for the gamecontroller test, but it also has some commented out code that uses the event API instead (like we do here). Can you test that again? Switch the comments in 456-457 like so: test_gamecontroller_events(gamepad);
// test_gamecontroller_state(gamepad); And remove the Thanks mickski56; that puts some perspective on things! |
Still works. the
|
The only remaining differences I can see from the implementation here and in sdl-jstest are:
I suspect 2. is the culprit. I'll implement this later today. |
Above commit loads the |
It seems after your work re: controller bindings, the ability to move the ships with the controller was removed. This is with the SDL2 platform, of course.
Edit: bisected to b2e3ae8.
The text was updated successfully, but these errors were encountered: