Keyboard backspace

I found this http://twolivesleft.com/Codea/Talk/discussion/comment/5706 really helpful in figuring out how to get backspace to work with showkeyboard()

snippet below

function keyboard(key)
        if key ~= nil then
            if string.byte(key) == 10 then
                --do something with "return" key
            elseif string.byte(key) == nil then --must be a backspace
                if string.len(yourtext) > 0 then
                    yourtext = string.sub(yourtext, 1, string.len(yourtext) - 1)
                end
            else
                yourtext = yourtext..key
            end
        end
end

(this is to make it easier to search for in this forum)

From the reference, I think you can determine whether the pressed key is BACKSPACE key or not by comparing the key with constant BACKSPACE as follows

if key==BACKSPACE then
  print("press Backspace") 
end 

Thanks! This will be helpful in the future!

Ah, I must have scrolled right past that.