Type Boolean Object InputDevice Revision Current Public Release (2017.3184) Keywords device, input, isConnected
Determines if the input device is currently connected to the system and can provide input events.
true if the input device is currently available. The connectionState property will be in the "connected" state in this case.
false if the input device is unavailable and cannot provide input events. The connectionState property will be in the "disconnected", "disconnecting", or "connecting" state in this case.
-- Called when the status of an input device has changed. local function onInputDeviceStatusChanged( event ) if event.connectionStateChanged then if event.device.isConnected then -- Device has been connected. -- If was once disconnected, then you should resume the game. else -- Connection has been lost. -- You may want to pause the game and warn the user in this case. end end end -- Set up the above function to receive input device status change events. Runtime:addEventListener( "inputDeviceStatus", onInputDeviceStatusChanged )