If you mean the return key on the iPad, then this works.
function keyboard(key)
if key == RETURN then
print("return key pressed")
end
end
I have added this page about RETURN to the wiki.
Thanks guys this was exactly what I was looking for. Especially the function keyboard(key), I was unaware that that existed
Here is an ASCII chart showing the supported characters and their values. Also, you can press any key and get the character, decimal, and hex value for that key. Hope this helps anyone unfamiliar with the keyboard function.
-- Ascii chart and key values
supportedOrientations(PORTRAIT)
function setup()
displayMode(FULLSCREEN)
showKeyboard()
cval="char ="
dval="dec ="
hval="hex ="
end
function draw()
background(30,30,30)
textMode(CORNER)
text("ASCII CHART",200,950)
text("PRESS ANY KEY",600,950)
text(cval,600,900)
text(dval,600,850)
text(hval,600,800)
z=0
textMode(CENTER)
for y=1,16 do
for x=1,16 do
xx=20+x*30
yy=950-y*40
fill(255,0,0)
text(z,xx,yy)
fill(0,255,0)
text(string.char(z),xx,yy-20)
z = z + 1
end
end
-- re-show keyboard if hide keyboard key is pressed
if CurrentTouch.x > 650 and CurrentTouch.y < 100 then
showKeyboard()
end
end
function keyboard(key)
if string.byte(key) == nil then
cval="nil"
dval="nil"
hval="nil"
return
end
cval=string.format("char = %s",key)
dval=string.format("dec = %3d",string.byte(key))
hval=string.format("hex = %02X",string.byte(key))
end