key event
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. | |||
Code | <nowiki>
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.")
else
print("The player pressed", keys.getName(key_code))
end
</nowiki>
|
key Event | |
---|---|
Returns
| |
Source | CC:Tweaked |
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.