Fixed issue where key event does not occur when focus is lost (#24)