Elite Dangerous has a really nice system for this. It uses DirectX I think and just checks for “axes”, and you can hook input up to either a key or an axis.
Would really love to use a joystick for flying a plane on ROBLOX or even the full HOTAS for throttle / rudder pedals.