Fixed the key events not working in Firefox.