There is described a method for operating an inhalation chamber. A duct in the inhalation chamber extends from a metered-dose inhaler input to a patient output, the duct comprising two portions, each having a shape, the shapes being complementary to form the duct, and displaceable in relation with each other. One of a MDI (or pMDI) and a nebulizer is connected to the inhalation chamber. If the metered-dose inhaler is connected, a relative displacement is made between the two portions of the duct to close the duct and shunt the dead volume of the inhalation chamber, making a direct passage from the pMDI to the patient. If the nebulizer is connected, a relative displacement is made between the two portions of the duct to open the duct to an inner volume of the inhalation chamber where the nebulizer is dispensing aerosol. Other configurations are also possible.