Use external function for events and handle keyboard arrows.