I can pair my PlayStation DualShock 3 Controller, but why are the buttons mixed up?
Unfortunately there are few Mac games that come with PS3 controller support. Portal 2 isn't one of them—like most Steam games, it only natively supports the Xbox 360 controller.

You can map controller actions to keyboard and mouse events with software like ControllerMate. It has a learning curve, but it's very configurable. To make a Portal 2 configuration for your PS3 controller, the main problems are the analog sticks, which are sometimes difficult to work with in ControllerMate.

Here are two screenshots from my configuration that should help:





You can make a virtual mouse for the right stick with “Create Virtual Device”

There's some good documentation for all the building blocks here.