add direction touch and keyboard logic