Fix gamepad removal not working properly
This commit is contained in:
@ -84,7 +84,7 @@ public class Application
|
||||
for idx in 0...SDL_NumJoysticks()
|
||||
{
|
||||
if SDL_IsGameController(idx) != SDL_TRUE { continue }
|
||||
Input.instance.padConnectedEvent(index: idx)
|
||||
Input.instance.padConnectedEvent(deviceIndex: idx)
|
||||
}
|
||||
|
||||
do
|
||||
@ -129,9 +129,9 @@ public class Application
|
||||
Input.instance.releaseEvent(scan: event.key.keysym.scancode)
|
||||
case SDL_CONTROLLERDEVICEADDED:
|
||||
if SDL_IsGameController(event.cdevice.which) != SDL_TRUE { break }
|
||||
Input.instance.padConnectedEvent(index: event.cdevice.which)
|
||||
Input.instance.padConnectedEvent(deviceIndex: event.cdevice.which)
|
||||
case SDL_CONTROLLERDEVICEREMOVED:
|
||||
Input.instance.padRemovedEvent(index: event.cdevice.which)
|
||||
Input.instance.padRemovedEvent(id: event.cdevice.which)
|
||||
case SDL_CONTROLLERBUTTONDOWN:
|
||||
Input.instance.padButtonPressEvent(id: event.cbutton.which, btn: event.cbutton.button)
|
||||
case SDL_CONTROLLERBUTTONUP:
|
||||
|
Reference in New Issue
Block a user