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

Saitek P220 Linux mapping #416

Closed
Ambrevar opened this issue Jan 7, 2021 · 3 comments
Closed

Saitek P220 Linux mapping #416

Ambrevar opened this issue Jan 7, 2021 · 3 comments

Comments

@Ambrevar
Copy link
Contributor

Ambrevar commented Jan 7, 2021

Steam allowed me to generate the following mappings for Linux:

03000000a30600000701000000010000,dev:gen:p220,platform:Linux,a:b2,b:b3,y:b1,x:b0,start:b5,leftx:a0,lefty:a1,lefttrigger:b6,righttrigger:b7,guide:,back:b4,

It's similar to the Windows mapping added in #249, but for a few thing:

  • Notice the 6th digit from the end is a 1 instead of a 0 for Windows. Out of curiosity, does anyone know how this works?

  • I've bount leftx and lefty to a0 and a1 respectively, while the Windows version binds the dp* buttons to +a1, -a1, +a0, -a0. What's the difference between leftx/lefty and the dp buttons? What are the + - signs for?

  • Steam generated dev:gen:p220, is this useful? Should it be replaced with Saitek P220?

Apologies in advance if I'm asking too many questions! :)

@AliceLR
Copy link
Contributor

AliceLR commented Jan 7, 2021

  • Notice the 6th digit from the end is a 1 instead of a 0 for Windows. Out of curiosity, does anyone know how this works?

IIRC this portion of the GUID is generated from the driver version and so it tends to vary between platforms.

  • I've bount leftx and lefty to a0 and a1 respectively, while the Windows version binds the dp* buttons to +a1, -a1, +a0, -a0. What's the difference between leftx/lefty and the dp buttons? What are the + - signs for?

I don't personally own this controller so I can't check in any immediate sense but from what I remember, the dpad for this controller sends analog axis events. The dp rules in the Windows mapping translate those to dpad controls, which is how the user who helped write that mapping expected them to behave (this may be subjective though).

dpdown:+a1 means that when axis 1 is positive, that should be translated to a dpad down press. Similarly, dpup:-a1 translates negative movement on axis 1 to dpad up. Another thing that can be done (but isn't used in that mapping) is axes can be inverted with something like leftx:a0~.

  • Steam generated dev:gen:p220, is this useful? Should it be replaced with Saitek P220?

That looks like a placeholder name and you are correct, it should probably be replaced.

@offalynne
Copy link
Collaborator

offalynne commented Jan 7, 2021

Notice the 6th digit from the end is a 1 instead of a 0 for Windows. Out of curiosity, does anyone know how this works?

https://hg.libsdl.org/SDL/file/f8adeeb9214b/src/joystick/SDL_joystick.c#l1584

I've bount leftx and lefty to a0 and a1 respectively, while the Windows version binds the dp* buttons to +a1, -a1, +a0, -a0. What's the difference between leftx/lefty and the dp buttons? What are the + - signs for?

As AliceLR says, the mapping is the same, it's just a Dpad binding instead of a Left Stick binding. See #260

Steam generated dev:gen:p220, is this useful? Should it be replaced with Saitek P220?

Steam Input uses dev:[type] to indicate which from it's list of supported controller types the user selected at the export step, in this case type is 'General'. The rest is the name provided (p220) which can indeed be replaced by a more useful name (Saitek P220 looks good).

@Ambrevar
Copy link
Contributor Author

Ambrevar commented Jan 7, 2021

Makes sense, thanks for your feedback!

See #417 for the final patch. Closing.

@Ambrevar Ambrevar closed this as completed Jan 7, 2021
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

No branches or pull requests

3 participants