console.keyhit readonly property

The console.keyhit property checks if a key has been pressed, returning true or false otherwise.

Example

local console = require "console" print("Waiting for a key press...") while not console.keyhit do sleep() end