fixed problem with KeyPressEvent on mainWindow