How can I map buttons on my PS3 controller to keystrokes on my Mac?

Solution 1:

Yeah there's an application called "ControllerMate" that you can get here http://www.orderedbytes.com/controllermate/ . You pair the controller to the mac with USB (I think Bluetooth will work too but you might have to look up special instructions), then use this app to bind the controller functions to keys and mouse movements. It works really well. I used to use it to play things like Portal because they don't natively support the PS3 controller.

Solution 2:

Enjoy allows to map buttons to keystrokes.

Here is the mapping I determined for my PS3 controller (connected via Bluetooth): The OSX mapping is used in games that directly support controllers, as Dustforce - where the SELECT button is mapped as pad0_btn3; there you would, of course, not use Enjoy.

Enjoy is a free program for Mac OS X 10.5+, focused on simplicity.

+------------------+---------------+-------------+
|      button      | Enjoy mapping | OSX mapping |
+------------------+---------------+-------------+
| left             |             8 |           7 |
| up               |             5 |           4 |
| right            |             6 |           5 |
| down             |             7 |           6 |
| L1               |            11 |          10 |
| L2               |             9 |           8 |
| R1               |            12 |          11 |
| R2               |            10 |           9 |
| select           |             1 |           0 |
| start            |             4 |           3 |
| PS-btn           |            17 |          16 |
| L3(left analog)  |             2 |           1 |
| R3(right analog) |             3 |           2 |
| ◻ square         |            16 |          15 |
| △ triangle       |            13 |          12 |
| ◯ circle         |            14 |          13 |
| X cross          |            15 |          14 |
+------------------+---------------+-------------+