return function(R)
    require('./ui/mouse')(R)

    local mouse=R.Mouse:new()
    local mouseState=nil

    R.tryBreak=function(key)
        key=key or 51
        if keyp(key) then
            exit()
        end
    end

    R.hideMouse=function()
        poke(0x3FFB,0)
    end

    R.ticWrap=function(tic)
        return function()
            mouseState=mouse:update()
            tic()
        end
    end

    function R.getMouse()
        return mouseState
    end
end