event.isCommandDown

类型 布尔值
事件 鼠标
版本 版本 2024.3703
关键词 鼠标, isCommandDown

概述

指示在鼠标事件发生时是否按住了 Command 键或 Windows 键。

示例

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