adds switching with arrow keys behavior