A PS3 controller doesn't work natively on PC due to protocol and driver differences. Here are the workarounds with their caveats:
Use an Xbox-compatible controller (Xbox Wireless Controller, 8BitDo Pro 2, PowerA wired) for native XInput support, lower latency, and guaranteed compatibility.