- keycode : number The keycode of the key being pressed
- held : boolean Wether or not the key was already pressed earlier and is currently being held down
Occurs every time the user presses down a key or when a key is being repeated because it's being held down.
|Showing what key the user is interacting with and telling if it's being held down.
while true do
local event, key_code, being_hold = os.pullEvent("key")
if being_hold then
print("The player is holding", keys.getName(key_code), "down.")
print("The player pressed", keys.getName(key_code))