object.type

类型 字符串
对象 InputDevice
修订版 发行版 2024.3703
关键字 设备、输入、类型

概述

指定连接到系统的设备类型的字符串。可能的值为

示例

-- 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 )