SDL: Added connect/disconnect gamepad events.

This commit is contained in:
Branimir Karadžić 2014-12-17 21:25:00 -08:00
parent cdc0c01503
commit 6315743251

View file

@ -502,6 +502,7 @@ namespace entry
if (isValid(handle) ) if (isValid(handle) )
{ {
m_gamepad[handle.idx].create(cev.which); m_gamepad[handle.idx].create(cev.which);
m_eventQueue.postGamepadEvent(defaultWindow, handle, true);
} }
} }
break; break;
@ -520,6 +521,7 @@ namespace entry
{ {
m_gamepad[handle.idx].destroy(); m_gamepad[handle.idx].destroy();
m_gamepadAlloc.free(handle.idx); m_gamepadAlloc.free(handle.idx);
m_eventQueue.postGamepadEvent(defaultWindow, handle, false);
} }
} }
break; break;