Added window.focus to allow arrow keys working