Implement dimension switching via arrow keys