keyboard.ispressed(key...)function

Checks if one or more keys have been pressed.

Parameters

key...

One or more string or number values that represents the keys to be checked. See the list of supported key codes.

Return value

This function true if all keys have been pressed or false otherwise.

Example

--! luart-extensions import keyboard local ui = require "ui" local win = ui.Window("Press key A, B and C simultaneously", 400, 280) local lbl = ui.Label(win, "Keys A+B+C have been pressed !") lbl:center() lbl:hide() await win:showasync() async(function() while win.visible do sleep() if keyboard.ispressed("A", "B", "C") then lbl:show() sleep(1000) elseif lbl.visible then lbl:hide() end end end) waitall()