handles keypresses and moves canvas