Skip to content

Commit

Permalink
Dualshock 3 bindings for OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
kivutar committed Nov 4, 2018
1 parent 22c498f commit 80664be
Showing 1 changed file with 48 additions and 10 deletions.
58 changes: 48 additions & 10 deletions input/binds_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package input
import "github.com/libretro/ludo/libretro"

var joyBinds = map[string]joybinds{
"Xbox 360 Wired Controller": xbox360JoyBinds,
"Xbox One Wired Controller": xbox360JoyBinds,
"Wireless Controller": ds4JoyBinds,
"8Bitdo NES30 Pro": nes30proJoyBinds,
"Xbox 360 Wired Controller": xbox360JoyBinds,
"Xbox One Wired Controller": xboxOneJoyBinds,
"Wireless Controller": ds4JoyBinds,
"PLAYSTATION(R)3 Controller": ds3JoyBinds,
"8Bitdo NES30 Pro": nes30proJoyBinds,
}

// Joypad bindings fox Xbox360 pad on OSX
// Joypad bindings fox Xbox 360 pad on OSX
var xbox360JoyBinds = joybinds{
bind{btn, 0, 0, 0}: libretro.DeviceIDJoypadUp,
bind{btn, 1, 0, 0}: libretro.DeviceIDJoypadDown,
Expand All @@ -28,11 +29,27 @@ var xbox360JoyBinds = joybinds{
bind{btn, 14, 0, 0}: libretro.DeviceIDJoypadX,
bind{axis, 4, 1, 0}: libretro.DeviceIDJoypadL2,
bind{axis, 5, 1, 0}: libretro.DeviceIDJoypadR2,
// Uncomment this to bind left analog to directions
// bind{axis, 0, -1, -0.5}: libretro.DeviceIDJoypadLeft,
// bind{axis, 0, 1, 0.5}: libretro.DeviceIDJoypadRight,
// bind{axis, 1, -1, -0.5}: libretro.DeviceIDJoypadUp,
// bind{axis, 1, 1, 0.5}: libretro.DeviceIDJoypadDown,
}

// Joypad bindings fox Xbox One pad on OSX
var xboxOneJoyBinds = joybinds{
bind{btn, 0, 0, 0}: libretro.DeviceIDJoypadUp,
bind{btn, 1, 0, 0}: libretro.DeviceIDJoypadDown,
bind{btn, 2, 0, 0}: libretro.DeviceIDJoypadLeft,
bind{btn, 3, 0, 0}: libretro.DeviceIDJoypadRight,
bind{btn, 4, 0, 0}: libretro.DeviceIDJoypadStart,
bind{btn, 5, 0, 0}: libretro.DeviceIDJoypadSelect,
bind{btn, 6, 0, 0}: libretro.DeviceIDJoypadL3,
bind{btn, 7, 0, 0}: libretro.DeviceIDJoypadR3,
bind{btn, 8, 0, 0}: libretro.DeviceIDJoypadL,
bind{btn, 9, 0, 0}: libretro.DeviceIDJoypadR,
bind{btn, 10, 0, 0}: ActionMenuToggle,
bind{btn, 11, 0, 0}: libretro.DeviceIDJoypadB,
bind{btn, 12, 0, 0}: libretro.DeviceIDJoypadA,
bind{btn, 13, 0, 0}: libretro.DeviceIDJoypadY,
bind{btn, 14, 0, 0}: libretro.DeviceIDJoypadX,
bind{axis, 4, 1, 0}: libretro.DeviceIDJoypadL2,
bind{axis, 5, 1, 0}: libretro.DeviceIDJoypadR2,
}

// Joypad bindings fox DualShock 4 pad on OSX
Expand All @@ -57,6 +74,27 @@ var ds4JoyBinds = joybinds{
bind{btn, 17, 0, 0}: libretro.DeviceIDJoypadLeft,
}

// Joypad bindings fox DualShock 3 pad on OSX
var ds3JoyBinds = joybinds{
bind{btn, 0, 0, 0}: libretro.DeviceIDJoypadSelect,
bind{btn, 1, 0, 0}: libretro.DeviceIDJoypadL3,
bind{btn, 2, 0, 0}: libretro.DeviceIDJoypadR3,
bind{btn, 3, 0, 0}: libretro.DeviceIDJoypadStart,
bind{btn, 4, 0, 0}: libretro.DeviceIDJoypadUp,
bind{btn, 5, 0, 0}: libretro.DeviceIDJoypadRight,
bind{btn, 6, 0, 0}: libretro.DeviceIDJoypadDown,
bind{btn, 7, 0, 0}: libretro.DeviceIDJoypadLeft,
bind{btn, 8, 0, 0}: libretro.DeviceIDJoypadL2,
bind{btn, 9, 0, 0}: libretro.DeviceIDJoypadR2,
bind{btn, 10, 0, 0}: libretro.DeviceIDJoypadL,
bind{btn, 11, 0, 0}: libretro.DeviceIDJoypadR,
bind{btn, 12, 0, 0}: libretro.DeviceIDJoypadX,
bind{btn, 13, 0, 0}: libretro.DeviceIDJoypadA,
bind{btn, 14, 0, 0}: libretro.DeviceIDJoypadB,
bind{btn, 15, 0, 0}: libretro.DeviceIDJoypadY,
bind{btn, 16, 0, 0}: ActionMenuToggle,
}

// Joypad bindings fox the 8BITDO NES30 PRO GamePad (Wired) on OSX
var nes30proJoyBinds = joybinds{
bind{btn, 0, 0, 0}: libretro.DeviceIDJoypadA,
Expand Down

0 comments on commit 80664be

Please sign in to comment.