Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Better controller support on linux is needed #258

Closed
SandWoodJones opened this issue May 9, 2021 · 6 comments
Closed

Better controller support on linux is needed #258

SandWoodJones opened this issue May 9, 2021 · 6 comments

Comments

@SandWoodJones
Copy link

I'm using Arch Linux, and been having problems with setting up Ikemen-Go to use my DS4 controller.
First of all, I can't change the controller configuration through the in-game joystick config GUI as it doesn't capture any input from my controller, making me unable to edit it.
To fix this, I had to use jstest to get the ID number of each button and then manually map it to the config.json file. This also had problems since I couldn't figure out the ID numbers for the joystick and the D-Pad as they're axis, not buttons. Strangely enough the only movement I could get was moving left, by pressing Up on the D-Pad.
Then I decided to just add the game to my steam library as a non-steam game and use its built-in controller remapping, mapping each button and axis to a keyboard key.
This works, but it's not perfect nor optimal.

@ssj17vegeta
Copy link

Can confirm the current version is somewhat broken in terms of controller support (Ubuntu 21.04 here).

Plugging-in a Madcatz XBox controller crashes the program on startup and outputs this in the console :
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller) GLFW: Please report this bug in the Go package immediately.

Though it seems that error is being investigated here : go-gl/glfw#292

Plugging in a standard wired XBox 360 controller outputs no error, but the controls are completely non-responsive : D-Pad up and down are mixed up in the main menu, and I cannot input any buttons when configuring the controller in the options menu.

Will definitely try the steam mapping tomorrow as a workaround though :)

@Orochikyocr
Copy link

Can confirm this.
Qanba Cristal Clear and Generic PS3 sticks which both works on windows doesn't not work on Linux in the config input menu.
Also DS4, PS3 and my Bluetooth Marvo Gt62 controller doesn't work in the config menu.
All of them work if I configure them directly from the config.json.

@ssj17vegeta
Copy link

ssj17vegeta commented Jul 10, 2021

It seems the problem I was talking about ( glfw/glfw#1763 ) has been fixed 15 days ago, and will be integrated in 3.3.5. There's hope :)

Also tried to fiddle with config.json to no avail : buttons are registered OK, but the it seems the D-Pad axes are considered buttons instead of axes so... yah :(

@SeongGino
Copy link

SeongGino commented Nov 1, 2021

Huh, so I'm not the only one who noticed.

Updating to 0.98 made it so Ikemen stops crashing with a gamepad connected. But I tried to reconfigure two different Xinput controllers; neither register in the config menu, despite working enough to navigate to said menu.

@Orochikyocr
Copy link

Orochikyocr commented Nov 8, 2021

Yes, 0.98, my sticks are still broken. Ps3 and xbox 360 one. My generic Marvo Controller works out of the box.
The same situation, I can configure my sticks from the config.json and they work, except in the joystick input config menu.

@ssvb
Copy link
Contributor

ssvb commented Aug 6, 2022

The joysticks test program from https://github.com/glfw/glfw shows the following for my PS3 controller in Linux in an idle state (no buttons are pressed):
ps3_idle_state

The sliders in the leftmost state (highlighted by the arrows) correspond to L2/R2 analog buttons of the PS3 controller. If I slowly press these buttons, then the sliders gradually move to the right and reach the rightmost side when the buttons are fully pressed.

Now how is all of this related to the broken joystick config in Ikemen-GO? The code at https://github.com/ikemen-engine/Ikemen-GO/blob/0.98.2/src/script.go#L1291-L1335 checks the joystick button state when configuring the joystick. In an idle PS3 controller state with no buttons pressed, the array axes typically looks like [-0.0039215684 0.027451038 -1 0.011764765 -0.035294116 -1]. The elements with indexes 2 and 5 contain -1, which is interpreted by the code as if some of the buttons are always pressed (the return value is "-11"). And then this return value is used by code at https://github.com/ikemen-engine/Ikemen-GO/blob/0.98.2/external/script/options.lua#L1754-L1761, which expects to see that some joystick button gets pressed and then all buttons are released. If it can never see that all buttons are released, then it can't work properly.

I have a pull request with a fix for my PS3 controller: #629. The other controllers probably fail because of something similar. But I wonder why people are not complaining about Windows? Also the code seems to already have some special handling for xbox 360 controller and yet people reported problems with it in Linux.

@ikemen-engine ikemen-engine locked and limited conversation to collaborators Jan 22, 2023
@K4thos K4thos converted this issue into discussion #861 Jan 22, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants