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

[Input] Get mapped joy events for joypad #100791

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MJacred
Copy link
Contributor

@MJacred MJacred commented Dec 24, 2024

Get the buttons and axes mapped to the connected joypad w/o having to use them all.

Motivation behind this PR:

  • I want the user to be able to change their mappings in-game. This requires knowledge about the capabilities of their connected joypad. It also allows me to fetch a different joypad image.
    • different joypads have different buttons/axes available: some joypads have JOY_BUTTON_PADDLE_*, some don't. Some don't have JOY_BUTTON_MISC1, or JOY_AXIS_RIGHT_*, etc.
  • Using the joypad name is not reliable, as the same joypad can have different names on different platforms/APIs.
    • the guid is also not sensible

See attached test project:
joypad-event-test.zip

Output for my joypad using the test project:

Xbox 360 Controller
["a", "b", "x", "y", "back", "guide", "start", "leftstick", "rightstick", "leftshoulder", "rightshoulder", "dpup", "dpdown", "dpleft", "dpright"]
["leftx", "lefty", "rightx", "righty", "lefttrigger", "righttrigger"]

@MJacred MJacred requested a review from a team as a code owner December 24, 2024 14:53
@MJacred MJacred force-pushed the get_joy_mapping_info branch from 5ce890e to ee48457 Compare December 24, 2024 14:54
@MJacred MJacred requested a review from a team as a code owner December 24, 2024 14:54
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.

1 participant