modified: close popup and input <Space> in the case of Space key