Possible way to use keyboard as a controller

Was thinking about this after i read a post yesterday.Particularly useful for people with external keyboards or split mode with on screen keyboard. Press W,A,S,D,B,G,Backspace


--# Main
displayMode(FULLSCREEN_NO_BUTTONS)
supportedOrientations(LANDSCAPE_ANY)

function setup()
    KeyPressed="none"
    Colour=color(255, 255, 255, 255)
    move=vec2(0,0)
    x,y=0,0
    showKeyboard()
end

function draw()
    background(0, 0, 0, 255)
    text(KeyPressed,WIDTH-100,HEIGHT-50)
    
    x=x+move.x
    y=y+move.y
    fill(Colour)
    ellipse(WIDTH/2+x,HEIGHT/2+y,100)
end

function keyboard(key)
    KeyPressed=key
    if key=="w" then
        move.y = move.y + 1
    elseif key=="a" then
        move.x=move.x-1
    elseif key=="s" then
        move.y=move.y-1
    elseif key=="d" then
        move.x=move.x+1
    elseif key=="b" then
        Colour=color(0,169,255,255)
    elseif key=="g" then
        Colour=color(0,150,0,255)
    elseif key==BACKSPACE then
        close()
    end
end