事件。reconfigured

类型 布尔值
时间 inputDeviceStatus
版本 版本 2024.3703
关键字 inputDeviceStatus, reconfigured

概览

如果输入设备经过重新配置,将设置为 true,例如当轴输入已添加到设备或从设备中删除时,displayName 已更改或其他配置更改。您可以通过 event.device 属性来访问配置已更改的设备。

如果输入设备的配置尚未更改,将设置为 false。这意味着输入设备状态的其他某些方面已更改,例如其与系统连接或从系统断开连接。

疑难解答

在 Android 上,操作系统通常会更改在断开连接后重新连接至系统的输入设备的 androidDeviceId

示例

-- Called when the status of an input device has changed.
local function onInputDeviceStatusChanged( event )
    if event.reconfigured then
        print( event.device.displayName .. " has been reconfigured." )
    end
end

-- Set up the above function to receive input device status change events.
Runtime:addEventListener( "inputDeviceStatus", onInputDeviceStatusChanged )