Skip to content
Vadim Grigoruk edited this page Nov 22, 2026 · 1 revision
  • keyr(code) -> is_released
  • keyr() -> is_any_released

Parameters

  • code : the key code to check (1..94), see the key map or type help keys in console.

Returns

  • 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

Description

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.

Example

-- 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)
end

Home
Tips for newcomers

Built-in Editors

Code | Sprites | Maps | SFX | Music

Console

All commands

save | export | load | import | menu | config | surf | shelf | demo | eval 

Platform

RAM | VRAM | Display | Palette | Bits per Pixel (BPP) | .tic Format | Supported Languages

Other

Tutorials | Code Snippets | Libraries | External Tools | FFT


API

All API functions

Callbacks

TIC | BOOT | MENU | BDR

  • SCN (deprecated)
  • OVR (deprecated)

Input

btn | btnp | btnr | key | keyp | keyr | mouse

Drawing

circ | circb | clip | cls | elli | ellib | font | line | map | paint | pix | print | rect | rectb | rrect | rrectb | spr | tri | trib | ttri | fill patterns

Sound

music | sfx | FFT | VQT

Memory

memcpy | memset | mget | mset | peek | poke | pmem | sync | vbank

System

exit | reset | time | tstamp | trace

Clone this wiki locally