Aquesta funció torna true o false segons la tecla que s'especifica com a paràmetre estiga polsada o no. Aquesta funció tornarà true tot el temps que la tecla es mantinga polsada. La funció germana, btnp, torna true només just al pulsar la tecla.
function init()
x,y = 10,7
mode(2)
end
function update()
cls()
if btn(KEY_UP) then
y = mid(0,y-1,14)
elseif btn(KEY_DOWN) then
y = mid(0,y+1,14)
end
if btn(KEY_LEFT) then
x = mid(0,x-1,19)
elseif btn(KEY_RIGHT) then
x = mid(0,x+1,19)
end
color(COLOR_YELLOW,COLOR_BLACK)
print("\224", x, y)
end