Better controller support on linux is needed #861
Replies: 14 comments 7 replies
-
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 : 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 :) |
Beta Was this translation helpful? Give feedback.
-
Can confirm this. |
Beta Was this translation helpful? Give feedback.
-
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 :( |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Yes, 0.98, my sticks are still broken. Ps3 and xbox 360 one. My generic Marvo Controller works out of the box. |
Beta Was this translation helpful? Give feedback.
-
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): 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 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. |
Beta Was this translation helpful? Give feedback.
-
i also notice this. func JoystickState(joy, button int) bool {
if joy < 0 {
return sys.keyState[Key(button)]
}
if joy >= input.GetMaxJoystickCount() {
return false
}
var axes []float32
if button >= 0 {
// Query button state
btns := input.GetJoystickButtons(joy)
if button >= len(btns) {
return false
}
switch button {
case 10: // Up: check axis and d.pad(hat)
axes = input.GetJoystickAxes(joy)
return (axes[1] < -0.5)|| (btns[11] != 0)
case 11: // Right: check axis and d.pad(hat)
axes = input.GetJoystickAxes(joy)
return (axes[0] > 0.5) || (btns[12] != 0)
case 12: // Down: check axis and d.pad(hat)
axes = input.GetJoystickAxes(joy)
return (axes[1] > 0.5) || (btns[13] != 0)
case 13: // Left: check axis and d.pad(hat)
axes = input.GetJoystickAxes(joy)
return (axes[0] < -0.5) || (btns[14] != 0)
default: // Other (normal) button
return btns[button] != 0
}
} else {
axes = input.GetJoystickAxes(joy)
if len(axes) < 6 {
return false
}
switch button {
case -12:
return (axes[2] > -0.5)
case -10:
return (axes[5] > -0.5)
default:
return false
}
}
} That code fix:
i tested Native Linux Build in Steam Deck using SteamOS. |
Beta Was this translation helpful? Give feedback.
-
I use Ikemen_GO_Linux (v0.99.0) in Steamdeck (SteamOS). |
Beta Was this translation helpful? Give feedback.
-
You can't configure this in config.json right now. So patching the code would be necessary to make this possible. However your patch is tailored for your specific joystick hardware and ruins joystick support for everyone else, so it's unlikely to be accepted. The magic button id numbers are even different in Windows and Linux. |
Beta Was this translation helpful? Give feedback.
-
same problem. can't configure the gamepad. It's recognized by the game but the directions are all wrong with left and right mapped to up and down. (!) it's a generic xbox one gamepad (that works everywhere else) using the xone dkms driver. I'm on arch linux. I tried to check the names of the buttons with jstest but i have no idea what i'm supposed to put for the DPad. Axis6+? Only workaround i got is to disable completely the joystick (by putting |
Beta Was this translation helpful? Give feedback.
-
Exactly like i do with mugen for around 20 years now, which is like you described, OPTIONS" -> "Input Settings" -> "Joystick Config" -> "Config all". Except nothing happens when i press any buttons or sticks when i do that. Note that the joystick replies for the rest, like navigating menus and actually play. Though it's really badly mapped. |
Beta Was this translation helpful? Give feedback.
-
what's system are you using for Ikemen/Mugen? PC? Windows? Linux? Handheld? Console? |
Beta Was this translation helpful? Give feedback.
-
Continuing this discussion because mapping gamepads on RetroPie (Raspbian, Raspberry Pi 5, ARM64) is really inconsistent. It detected my RetroBit Genesis 2.4 GHz pad temporarily last night and now I can't seem to get IKEMEN-GO to detect it again, let alone remap it. What's odd is, I can hit an oddly specific button to "Configure all" (B) on my pad, but pressing that same button again isn't picked up by the joystick mapping configuration to assign a button! It won't even detect my directions for some reason! EDIT: The issue seems to be that it thinks my gamepad should be assigned to Player 3 for some reason. EDIT2: Just set your Joystick index in your config.json to the index of the working joystick for the player you want to configure it for. |
Beta Was this translation helpful? Give feedback.
-
Could you show me the setting in config.json that work for you? Mine like this and does not work on SteamOS :
|
Beta Was this translation helpful? Give feedback.
-
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.
Beta Was this translation helpful? Give feedback.
All reactions