Wiki

Clone wiki

Core / RETURN

Back to Beyond the Codea in-app reference


FunctionIconConst-Small.png RETURN global variable

Introduction

Codea's in-app reference documents the BACKSPACE global variable. The use of the undocumented RETURN global variable is similar. RETURN is built-in to refer to a string that can be compared with the value referenced by key in keyboard(key) when the 'return' key is pressed. For example:

function keyboard(key)
    -- Did the user press the return key?
    if key == RETURN then
        -- Do something
    end
end

Value referenced by RETURN

The value referenced by RETURN is "\n", a string containing only a carriage return character. For example:

print(RETURN == "\n") -- Outputs: true

Updated