exequielc
deac
stana
Hi All;
I have “4 Buttons and joystick”.I only configurated the two joysticks and button A, B, start and select with making the inversion between up and down for my 2 joysticks Device :
Xarcade-to-Gamepad Device 1
Xarcade-to-Gamepad Device 2
and my OnePAD.ini is :
log = 0
options = 1668440408
mouse_sensibility = 500
joy_pad_map = 256
ff_intensity = 32767
[0][name] = Xarcade-to-Gamepad Device 1
[0][0] = 0×0
[0][1] = 0×0
[0][2] = 0×0
[0][3] = 0×0
[0][4] = 0×0
[0][5] = 0×10003
[0][6] = 0×10004
[0][7] = 0×0
[0][8] = 0×10005
[0][9] = 0×0
[0][10] = 0×0
[0][11] = 0×10008
[0][12] = 0×20001
[0][13] = 0×20000
[0][14] = 0×20101
[0][15] = 0×20100
[0][16] = 0×0
[0][17] = 0×0
[0][18] = 0×0
[0][19] = 0×0
[0][20] = 0×0
[0][21] = 0×0
[0][22] = 0×0
[0][23] = 0×0
[0][24] = 0×10005
[1][name] = Xarcade-to-Gamepad Device 2
[1][0] = 0×0
[1][1] = 0×0
[1][2] = 0×0
[1][3] = 0×0
[1][4] = 0×0
[1][5] = 0×10003
[1][6] = 0×10004
[1][7] = 0×0
[1][8] = 0×10005
[1][9] = 0×0
[1][10] = 0×0
[1][11] = 0×10008
[1][12] = 0×20001
[1][13] = 0×20000
[1][14] = 0×20101
[1][15] = 0×20100
[1][16] = 0×0
[1][17] = 0×0
[1][18] = 0×0
[1][19] = 0×0
[1][20] = 0×0
[1][21] = 0×0
[1][22] = 0×0
[1][23] = 0×0
[1][24] = 0×10005
also @exequielc my pcsx2Controllers.py is
#!/usr/bin/env python
#-- coding: utf-8 --
import batoceraFiles
import os
#Create the controller configuration file
def generateControllerConfig(system, playersControllers, rom):
pcsx2Keys = {
0: “l2”,
1: “r2”,
2: “pageup”,
3: “pagedown”,
4: “x”,
5: “a”,
6: “b”,
7: “y”,
8: “select”,
9: “l3”,
10: “r3”,
11: “start”,
12: “up”,
13: “right”,
14: “down”,
15: “left”,
16: “joystick1up”,
17: “joystick1right”,
18: “joystick1down”,
19: “joystick1left”,
20: “joystick2up”,
21: “joystick2right”,
22: “joystick2down”,
23: “joystick2left”,
24: “hotkey”
}
configDir = “{}/{}”.format(batoceraFiles.pcsx2ConfigDir, “inis”)
configFileName = “{}/{}”.format(configDir, “OnePAD9.ini”)
if not os.path.exists(configDir):
os.makedirs(configDir)
f = open(configFileName, “w”)
f.write(“log = 0\n”)
f.write(“options = -1077554016\n”)
f.write(“mouse_sensibility = 500\n”)
f.write(“joy_pad_map = 256\n”)
f.write(“ff_intensity = 32767\n”)
nplayer = 0
#players with a controller
for playercontroller, pad in sorted(playersControllers.items()):
if nplayer < 2:
f.write(“[{}][name] = {}\n”.format(nplayer, pad.realName))
for x in pcsx2Keys:
writeKey(f, nplayer, x, pcsx2Keys[x], pad.inputs)
nplayer += 1
#players without controller
for i in range(nplayer, 2):
f.write(“[{}][name] = \n”.format(i))
for x in pcsx2Keys:
f.write(“[{}][{}] = 0×0\n”.format(i, x))
f.close()
def writeKey(f, nplayer, x, key, padInputs):
configkey = key
#reversed keys
reversedAxis = False
if key == “joystick1down”:
reversedAxis = True
configkey = “joystick1up”
elif key == “joystick1right”:
reversedAxis = True
configkey = “joystick1left”
elif key == “joystick2down”:
reversedAxis = True
configkey = “joystick2up”
elif key == “joystick2right”:
reversedAxis = True
configkey = “joystick2left”
if configkey in padInputs:
input = padInputs[configkey]
#f.write(“# key: name=”+input.name+“, type=”+input.type+“, id=”+str(input.id)+“, value=”+str(input.value)+“\n”)
if input.type == “button”:
f.write(“[{}][{}] = 0x{:02x}\n”.format(nplayer, x, button_to_key(input.id)))
elif input.type == “axis”:
sign = 0
if input.value < 0:
sign = 1
if reversedAxis:
if sign == 0:
sign = 1
else:
sign = 0
f.write(“[{}][{}] = 0x{:02x}\n”.format(nplayer, x, axis_to_key(0, sign, input.id)))
elif input.type == “hat”:
f.write(“[{}][{}] = 0x{:02x}\n”.format(nplayer, x, hat_to_key(input.value, input.id)))
else:
f.write(“[{}][{}] = 0×0\n”.format(nplayer, x))
def button_to_key(button_id):
return (0×10000 | int(button_id))
def axis_to_key(full_axis, sign, axis_id):
return (0×20000 | (full_axis << 9) | (sign << 8) | int(axis_id));
def hat_to_key(dir, axis_id):
return (0×30000 | (int(dir) << 8) | int(axis_id))