Repository navigation
keyr
Vadim Grigoruk edited this page Nov 22, 2026
·
1 revision
keyr(code) -> is_releasedkeyr() -> is_any_released
-
code : the key code to check (1..94), see the key map or type
help keysin console.
- is_released : the key was pressed in the previous frame and is not pressed now (true/false)
- is_any_released : true if any key was released since the previous frame
This function returns true only for the frame in which the given key goes up. Use keyp for the opposite edge (newly pressed) and key for the held state.
-- count the keys released during a frame
releases = 0
function TIC()
cls(0)
if keyr(1) then -- the A key
releases = releases + 1
end
print("released: " .. releases, 10, 10, 12)
endTIC-80 tiny computer https://tic80.com | Twitter | Telegram | Terms
Built-in Editors
Console
save | export | load | import | menu | config | surf | shelf | demo | eval
Platform
RAM | VRAM | Display | Palette | Bits per Pixel (BPP) |
.ticFormat | Supported Languages
Other
Tutorials | Code Snippets | Libraries | External Tools | FFT
API
Callbacks
Input
Drawing
circ | circb | clip | cls | elli | ellib | font | line | map | paint | pix | print | rect | rectb | rrect | rrectb | spr | tri | trib | ttri | fill patterns
- textri (deprecated)
Sound
Memory
memcpy | memset | mget | mset | peek | poke | pmem | sync | vbank
System