Files
Basalt/docs/docs1_6/objects/Basalt/isKeyDown.md
Robert Jelic d4c72514ef Docs 1.6
Accidentally uploaded outdated 1.6 docs
2023-05-01 16:28:46 +02:00

580 B

Basalt

isKeyDown

Checks if the user is currently holding a key

Parameters

  1. number key code (use the keys table for that)

Returns

  1. boolean true or false

Usage

  • Shows a debug message with true or false if the left ctrl key is down, as soon as you click on the button.
local main = basalt.createFrame()
local aButton = mainFrame:addButton()
    :setPosition(2,2)
    :setText("Check Ctrl")
    :onClick(function() 
        basalt.debug(basalt.isKeyDown(keys.leftCtrl))
    end)
basalt.autoUpdate()