Abstract: A voltage output based on the resistance, which is determined by how a contact member on an adjusting lever is connected to a resistance member on the side of a carriage, is detected as a head gap. The cap advancing/retracing distance during capping operation by a capping mechanism is adjusted according to the detected head gap. Consequently, the capping operation of the cap to hermetically cover a nozzle surface of a print head is performed effectively.