类型 数字 对象 输入轴 版本 版本 2024.3703 关键字 设备、输入、轴、最小、最小值、值
指示轴输入事件将提供的最小值。此属性和 object.maxValue 属性对于理解轴接收的原始数据非常必要,因为它将指示该轴相对于其范围移动的距离。
通常,操纵杆的最大和最小值范围分别为 1.0 和 -1.0。
触摸屏的最大值通常为屏幕像素长度,最小值为 0。
触控板的最大值通常是一个使用未知度量单位的大值,意味着你必须根据最小值和最大值属性来评估接收的轴数据的相对位置。
-- 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 minimum property values to the log
for axisIndex = 1,#inputAxes do
local inputAxis = inputAxes[axisIndex]
print( inputAxis.descriptor .. ": Min value = " .. tostring(inputAxis.minValue) )
end
end