object.maxValue

类型 数字
对象 InputAxis
修订版 2024.3703 版
关键字 设备、输入、轴、最大值、最大值、值

概述

指示轴输入事件将提供的最大值。此属性和 object.minValue 属性是理解轴接收的原始数据的必要条件,因为它将指示该轴在其范围内已移动的距离。

陷阱

示例

-- Fetch all input devices currently connected to the system
local inputDevices = system.getInputDevices()

-- Traverse all input devices
for deviceIndex = 1,#inputDevices do
    -- Fetch the input device's axes
    local inputAxes = inputDevices[deviceIndex]:getAxes()

    -- Print all axis maximum property values
    for axisIndex = 1,#inputAxes do
        local inputAxis = inputAxes[axisIndex]
        print( inputAxis.descriptor .. ": Max value = " .. tostring(inputAxis.maxValue) )
    end
end