this post was submitted on 21 Jun 2023
64 points (100.0% liked)

PC Gaming

25 readers
1 users here now

Discuss Games, Hardware and News on PC Gaming **Discord** https://discord.gg/4bxJgkY **Mastodon** https://cupoftea.social **Donate** https://ko-fi.com/cupofteasocial **Wiki** https://www.pcgamingwiki.com

founded 1 year ago
you are viewing a single comment's thread
view the rest of the comments
[–] atocci@kbin.social 4 points 1 year ago (2 children)

How does Steam Input work? Does it contain drivers for almost any controller, or does it just map inputs for those controllers to Xinput?

[–] HidingCat@kbin.social 3 points 1 year ago

It has support for a lot of controllers, including the popular console ones. It's really a nifty feature of Steam.

Most non-xbox controllers use well-known USB extents that are universally recognized as belonging to a generic controller. Windows will display a controller icon, libraries like pygame and SDL 2 will process them as regular controllers, etc. As such, most controllers need no drivers. The exception is that games written with directX use xinput, which is proprietary and has licensing costs to get your controller into (to prevent low-cost controllers from undercutting Microsoft's price-gouging official offering).

Converting USB controller to xinput has famously been a really hard problem, requiring a lot of fancy software that is often incompatible with anticheat and copy protection. Steam is able to do it because the steam overlay is whitelisted by everything that could block it, and is otherwise developped by really great devs.

In the process of intercepting inputs to the game and translating them, you can imagine it's quite easy to swap a button for another, that's how controller remapping works. Some devs additionnally provide steam with custom things a controller may do that may not have a key assigned but becomes callable from a key through the overlay.