event.isSecondaryButtonDown

类型 布尔
事件 鼠标
修订版 2024.3703 版
关键字 鼠标,isSecondaryButtonDown

概览

指示在鼠标事件发生时,是否按住了鼠标的辅助按钮。

请注意,辅助按钮通常是鼠标右键,除非最终用户将其与左键交换。

陷阱

低于 4.0 版本的 Android 设备不支持辅助鼠标按钮。对于那些较旧的设备,此属性始终设置为 false

示例

-- Called when a mouse event has been received.
local function onMouseEvent( event )
    if event.isSecondaryButtonDown then
        -- The mouse's secondary/right button is currently pressed down.
    else
        -- The mouse's secondary/right button is not being pressed.
    end
end
                             
-- Add the mouse event listener.
Runtime:addEventListener( "mouse", onMouseEvent )