Added keyboard event capture to main window