Convert ui position to command