Puzzle grid movement

Using the keyboard:

Using the mouse:

Switching direction: