Gamepad detection was added some time ago in Defold 1.2.157. Currently, I’m having trouble getting it to work.
The triggers ‘gamepad-connected’ and ‘gamepad-disconnected’ don’t happen for me, though the gamepad works fine once connected. I’m using a generic Xbox style gamepad on Windows.
function on_input(self, action_id, action) if action_id == hash("gp_connect") then self.gamepad = true elseif action_id == hash("gp_disconnect") then self.gamepad = false end end
Am I missing something?