object.type

Type String
Object InputDevice
Revision Release 2024.3703
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 )