Complied to JS and changed keyboard event listener to support Firefox.