Added the focus method to direct key events.