Type String Object InputDevice Revision Release 2024.3703 Keywords device, input, type
A string that specifies what kind of device is connected to the system. Possible values are:
"keyboard"
"mouse"
"stylus"
"trackball"
"touchpad"
"touchscreen"
"joystick"
"gamepad"
"directionalPad"
"steeringWheel"
"flightStick"
"guitar"
"drumSet"
"dancePad"
"unknown"
-- 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 )