Skip to content

Commit

Permalink
Correct Dualshock4 controller mappings and add ps/left/right buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Merrony committed May 20, 2018
1 parent 1a66da0 commit a5de5f6
Showing 1 changed file with 23 additions and 84 deletions.
107 changes: 23 additions & 84 deletions platforms/joystick/joystick_dualshock4.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,92 +4,31 @@ var dualshock4Config = joystickConfig{
Name: "Dualshock4 Controller",
GUID: "2222",
Axis: []pair{
pair{
Name: "left_x",
ID: 0,
},
pair{
Name: "left_y",
ID: 1,
},
pair{
Name: "right_x",
ID: 2,
},
pair{
Name: "right_y",
ID: 5,
},
pair{
Name: "l2",
ID: 3,
},
pair{
Name: "r2",
ID: 4,
},
pair{
Name: "up",
ID: 7,
},
pair{
Name: "down",
ID: 6,
},
pair{
Name: "left",
ID: 7,
},
pair{
Name: "right",
ID: 8,
},
pair{Name: "left_x", ID: 0},
pair{Name: "left_y", ID: 1},
pair{Name: "right_x", ID: 3},
pair{Name: "right_y", ID: 4},
pair{Name: "l2", ID: 2},
pair{Name: "r2", ID: 5},
pair{Name: "up", ID: 7},
pair{Name: "down", ID: 7},
pair{Name: "left", ID: 6},
pair{Name: "right", ID: 6},
},
Buttons: []pair{
pair{
Name: "square",
ID: 0,
},
pair{
Name: "triangle",
ID: 3,
},
pair{
Name: "circle",
ID: 2,
},
pair{
Name: "x",
ID: 1,
},
pair{
Name: "l1",
ID: 4,
},
pair{
Name: "l2",
ID: 6,
},
pair{
Name: "r2",
ID: 7,
},
pair{
Name: "r1",
ID: 5,
},
pair{
Name: "share",
ID: 8,
},
pair{
Name: "options",
ID: 9,
},
pair{
Name: "home",
ID: 12,
},
pair{Name: "x", ID: 0},
pair{Name: "circle", ID: 1},
pair{Name: "triangle", ID: 2},
pair{Name: "square", ID: 3},
pair{Name: "l1", ID: 4},
pair{Name: "r1", ID: 5},
pair{Name: "l2", ID: 6},
pair{Name: "r2", ID: 7},
pair{Name: "share", ID: 8},
pair{Name: "options", ID: 9},
pair{Name: "ps", ID: 10}, // the 'PlayStation' button
pair{Name: "left", ID: 11}, // push on left stick
pair{Name: "right", ID: 12}, // push on right stick
},
Hats: []hat{},
}

0 comments on commit a5de5f6

Please sign in to comment.