object.type

Type String
Object InputDevice
Revision 2017.3060
Keywords device, input, type

Overview

A string that specifies what kind of device is connected to the system. Possible values are:

Example

-- Called when a key event has been received.
local function onKeyEvent( event )
    if event.device then
        print( "Device Type: " .. event.device.type )
    end
end

-- Set up the above function to receive key events.
Runtime:addEventListener( "key", onKeyEvent )