Bluetooth keyboard

Is there any way to get a callback function for the arrow keys or say space bar on a Bluetooth keyboard, by using runtime or what?

I’ll look into it more, because I once knew how to do this, but here is a script to see what key is bing pressed:

-- Keyboard key

-- Use this function to perform your initial setup
function setup()
    currentKey = "Press a key"
    showKeyboard()
end

-- This function gets called once every frame
function draw()
    -- This sets a dark background color 
    background(40, 40, 50)

    -- This sets the line thickness
    strokeWidth(5)

    -- Do your drawing here
    text(currentKey,WIDTH/2,HEIGHT/2)
end

function keyboard (key)
    currentKey = key
end