There is described a method for operating an inhalation chamber. A duct in the inhalation chamber extends from an opening for a source of gas to an opening for patient output, the duct comprising two portions, of which the shapes are complementary to form the duct, and displaceable in relation with each other. A MDI (or pMDI) and/or a nebulizer are connected to the inhalation chamber. 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 source of gas to the patient. If the nebulizer or the MDI 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 or the MDI is dispensing aerosol. Other configurations are possible.