Here`s a little snippet of what I use for buttons as remember if you turn on a button you also need to turn it off, that might help you on the way ;-)
local XPState = false
local XNState = false
local YPState = false
local YNState = false
function GetXin(xinput)
local hreg = mc.mcRegGetHandle(inst, string.format("mcX360_LUA/%s", xinput))
return mc.mcRegGetValueString(hreg)
end
X360_Panel:Connect(wx.wxEVT_TIMER, function (event)
-- Y++
if GetXin("DPad_UP") == "1" and YPState == false then
mc.mcSignalSetState (mc.mcSignalGetHandle (inst, mc.ISIG_JOGYP), 1)
YPState = true
end
if GetXin("DPad_UP") == "0" and YPState == true then
mc.mcSignalSetState (mc.mcSignalGetHandle (inst, mc.ISIG_JOGYP), 0)
YPState = false
end
-- Y--
if GetXin("DPad_DOWN") == "1" and YNState == false then
mc.mcSignalSetState (mc.mcSignalGetHandle (inst, mc.ISIG_JOGYN), 1)
YNState = true
end
if GetXin("DPad_DOWN") == "0" and YNState == true then
mc.mcSignalSetState (mc.mcSignalGetHandle (inst, mc.ISIG_JOGYN), 0)
YNState = false
end
-- X++
if GetXin("DPad_RIGHT") == "1" and XPState == false then
mc.mcSignalSetState (mc.mcSignalGetHandle (inst, mc.ISIG_JOGXP), 1)
XPState = true
end
if GetXin("DPad_RIGHT") == "0" and XPState == true then
mc.mcSignalSetState (mc.mcSignalGetHandle (inst, mc.ISIG_JOGXP), 0)
XPState = false
end
-- X--
if GetXin("DPad_LEFT") == "1" and XNState == false then
mc.mcSignalSetState (mc.mcSignalGetHandle (inst, mc.ISIG_JOGXN), 1)
XNState = true
end
if GetXin("DPad_LEFT") == "0" and XNState == true then
mc.mcSignalSetState (mc.mcSignalGetHandle (inst, mc.ISIG_JOGXN), 0)
XNState = false
end
end)
DazTheGas