@@ -3,13 +3,14 @@ package input
33import "github.com/libretro/ludo/libretro"
44
55var joyBinds = map [string ]joybinds {
6- "Xbox 360 Wired Controller" : xbox360JoyBinds ,
7- "Xbox One Wired Controller" : xbox360JoyBinds ,
8- "Wireless Controller" : ds4JoyBinds ,
9- "8Bitdo NES30 Pro" : nes30proJoyBinds ,
6+ "Xbox 360 Wired Controller" : xbox360JoyBinds ,
7+ "Xbox One Wired Controller" : xboxOneJoyBinds ,
8+ "Wireless Controller" : ds4JoyBinds ,
9+ "PLAYSTATION(R)3 Controller" : ds3JoyBinds ,
10+ "8Bitdo NES30 Pro" : nes30proJoyBinds ,
1011}
1112
12- // Joypad bindings fox Xbox360 pad on OSX
13+ // Joypad bindings fox Xbox 360 pad on OSX
1314var xbox360JoyBinds = joybinds {
1415 bind {btn , 0 , 0 , 0 }: libretro .DeviceIDJoypadUp ,
1516 bind {btn , 1 , 0 , 0 }: libretro .DeviceIDJoypadDown ,
@@ -28,11 +29,27 @@ var xbox360JoyBinds = joybinds{
2829 bind {btn , 14 , 0 , 0 }: libretro .DeviceIDJoypadX ,
2930 bind {axis , 4 , 1 , 0 }: libretro .DeviceIDJoypadL2 ,
3031 bind {axis , 5 , 1 , 0 }: libretro .DeviceIDJoypadR2 ,
31- // Uncomment this to bind left analog to directions
32- // bind{axis, 0, -1, -0.5}: libretro.DeviceIDJoypadLeft,
33- // bind{axis, 0, 1, 0.5}: libretro.DeviceIDJoypadRight,
34- // bind{axis, 1, -1, -0.5}: libretro.DeviceIDJoypadUp,
35- // bind{axis, 1, 1, 0.5}: libretro.DeviceIDJoypadDown,
32+ }
33+
34+ // Joypad bindings fox Xbox One pad on OSX
35+ var xboxOneJoyBinds = joybinds {
36+ bind {btn , 0 , 0 , 0 }: libretro .DeviceIDJoypadUp ,
37+ bind {btn , 1 , 0 , 0 }: libretro .DeviceIDJoypadDown ,
38+ bind {btn , 2 , 0 , 0 }: libretro .DeviceIDJoypadLeft ,
39+ bind {btn , 3 , 0 , 0 }: libretro .DeviceIDJoypadRight ,
40+ bind {btn , 4 , 0 , 0 }: libretro .DeviceIDJoypadStart ,
41+ bind {btn , 5 , 0 , 0 }: libretro .DeviceIDJoypadSelect ,
42+ bind {btn , 6 , 0 , 0 }: libretro .DeviceIDJoypadL3 ,
43+ bind {btn , 7 , 0 , 0 }: libretro .DeviceIDJoypadR3 ,
44+ bind {btn , 8 , 0 , 0 }: libretro .DeviceIDJoypadL ,
45+ bind {btn , 9 , 0 , 0 }: libretro .DeviceIDJoypadR ,
46+ bind {btn , 10 , 0 , 0 }: ActionMenuToggle ,
47+ bind {btn , 11 , 0 , 0 }: libretro .DeviceIDJoypadB ,
48+ bind {btn , 12 , 0 , 0 }: libretro .DeviceIDJoypadA ,
49+ bind {btn , 13 , 0 , 0 }: libretro .DeviceIDJoypadY ,
50+ bind {btn , 14 , 0 , 0 }: libretro .DeviceIDJoypadX ,
51+ bind {axis , 4 , 1 , 0 }: libretro .DeviceIDJoypadL2 ,
52+ bind {axis , 5 , 1 , 0 }: libretro .DeviceIDJoypadR2 ,
3653}
3754
3855// Joypad bindings fox DualShock 4 pad on OSX
@@ -57,6 +74,27 @@ var ds4JoyBinds = joybinds{
5774 bind {btn , 17 , 0 , 0 }: libretro .DeviceIDJoypadLeft ,
5875}
5976
77+ // Joypad bindings fox DualShock 3 pad on OSX
78+ var ds3JoyBinds = joybinds {
79+ bind {btn , 0 , 0 , 0 }: libretro .DeviceIDJoypadSelect ,
80+ bind {btn , 1 , 0 , 0 }: libretro .DeviceIDJoypadL3 ,
81+ bind {btn , 2 , 0 , 0 }: libretro .DeviceIDJoypadR3 ,
82+ bind {btn , 3 , 0 , 0 }: libretro .DeviceIDJoypadStart ,
83+ bind {btn , 4 , 0 , 0 }: libretro .DeviceIDJoypadUp ,
84+ bind {btn , 5 , 0 , 0 }: libretro .DeviceIDJoypadRight ,
85+ bind {btn , 6 , 0 , 0 }: libretro .DeviceIDJoypadDown ,
86+ bind {btn , 7 , 0 , 0 }: libretro .DeviceIDJoypadLeft ,
87+ bind {btn , 8 , 0 , 0 }: libretro .DeviceIDJoypadL2 ,
88+ bind {btn , 9 , 0 , 0 }: libretro .DeviceIDJoypadR2 ,
89+ bind {btn , 10 , 0 , 0 }: libretro .DeviceIDJoypadL ,
90+ bind {btn , 11 , 0 , 0 }: libretro .DeviceIDJoypadR ,
91+ bind {btn , 12 , 0 , 0 }: libretro .DeviceIDJoypadX ,
92+ bind {btn , 13 , 0 , 0 }: libretro .DeviceIDJoypadA ,
93+ bind {btn , 14 , 0 , 0 }: libretro .DeviceIDJoypadB ,
94+ bind {btn , 15 , 0 , 0 }: libretro .DeviceIDJoypadY ,
95+ bind {btn , 16 , 0 , 0 }: ActionMenuToggle ,
96+ }
97+
6098// Joypad bindings fox the 8BITDO NES30 PRO GamePad (Wired) on OSX
6199var nes30proJoyBinds = joybinds {
62100 bind {btn , 0 , 0 , 0 }: libretro .DeviceIDJoypadA ,
0 commit comments