Skip to content

Instantly share code, notes, and snippets.

@robmiracle
Created August 6, 2015 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robmiracle/762e46403020c34497d2 to your computer and use it in GitHub Desktop.
Save robmiracle/762e46403020c34497d2 to your computer and use it in GitHub Desktop.
Code snippets for the Corona SDK Tutorial: Game controllers and axes (https://coronalabs.com/blog/2013/09/24/tutorial-controllers-and-axis)
local function onInputDeviceStatusChanged( event )
-- Handle the input device change
if ( event.connectionStateChanged ) then
print( event.device.displayName .. ": " .. event.device.connectionState, event.device.descriptor, event.device.type, event.device.canVibrate )
end
end
Runtime:addEventListener( "inputDeviceStatus", onInputDeviceStatusChanged )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment