Skip to content
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

Adding linux driver buttonmap for 8BitDo M30 #302

Merged
merged 1 commit into from
May 1, 2024

Conversation

mintsoft
Copy link

@mintsoft mintsoft commented Mar 8, 2024

No description provided.

@garbear
Copy link
Member

garbear commented Apr 28, 2024

Sorry, I missed this PR. It doesn't look like axis 4 is used, should this appear in the config?

@garbear
Copy link
Member

garbear commented Apr 28, 2024

You can test which axis is axis 4 in the "Ignore Input" dialog on the right of the controller config dialog.

@mintsoft
Copy link
Author

I'll check on Axis 4; it's a kind of weird pad that uses both buttons and axes simultaneously for things. I'll verify what is correct in a min

@mintsoft
Copy link
Author

Just checked and the additional axis are used when the shoulder buttons are pressed, but there is no analogue nature to them, they go from -32k when not pressed to +32k when pressed, so I would prefer to map the buttons 9/10 (or 8/9 if 0 indexed) than use the axes in this situation?

@garbear
Copy link
Member

garbear commented Apr 30, 2024

they go from -32k when not pressed to +32k when pressed

When a button is analog but only goes between discrete values, I call them "discrete analog" buttons. You can also see that Kodi detected axis 4 went from -32k (normalized to -1) to 32k (normalized to 1), which is a center of -1 and a range of 2:

<axis index="4" center="-1" range="2" />

When a button sends both analog and digital presses, Kodi appears to get two inputs very close together, which I call "rapid input" and drop the second input, in this case the axes.

So Kodi handles all these quirks just fine, but we might as well use the digital ones.

The analog axes should probably be marked as "ignored", which you can see how it's done with the PS4 controller: https://github.com/xbmc/peripheral.joystick/blob/Omega/peripheral.joystick/resources/buttonmaps/xml/linux/Sony_Interactive_Entertainment_Wireless_Controller_13b_8a.xml#L8-L9. You can use the ignore input dialog to generate these lines, then re-map and copy/paste the ignored axes into the XML.

@mintsoft
Copy link
Author

I've made that change; the controller physically looks and acts like a SEGA Saturn controller, is it preferred to map onto the Saturn profile (like the 8Bitdo_NES30_GamePad_16b_8a maps onto SNES) or is the generic one better?

@garbear
Copy link
Member

garbear commented May 1, 2024

Yes, can you map the profile that looks most like the controller? You'll see in the Peripherals list that it shows up as the controller you've mapped if it's the only buttonmap. The Saturn icon will also be shown in the in-game dialogs.

@mintsoft
Copy link
Author

mintsoft commented May 1, 2024

Done and done

@garbear
Copy link
Member

garbear commented May 1, 2024

Looks good. Can you squash the commits and title the commit "[Linux] Add buttonmap for ..."?

If you're not familiar with git, just do a soft-reset to master (git reset ad6bab7dd70c1bf51551e3d8a4082a724ca3f771) then you'll see that your xml is an uncommited file. So just add it and create a new commit message. Then force-push to GH (git push -f origin mintsoft-patch-1).

@mintsoft mintsoft force-pushed the mintsoft-patch-1 branch 2 times, most recently from 8706737 to 60839cb Compare May 1, 2024 08:42
@mintsoft
Copy link
Author

mintsoft commented May 1, 2024

Done

@garbear garbear merged commit 1482eb9 into xbmc:Omega May 1, 2024
7 checks passed
@garbear
Copy link
Member

garbear commented May 1, 2024

I got this in a new release for both Omega and Nexus, just in case you're on the older branch.

@mintsoft mintsoft deleted the mintsoft-patch-1 branch May 1, 2024 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants