A sliding cover for a liquid delivery device, such as a cap (100) for a pen injector (200), incorporates a set of sensors including a first optical sensor (110) with an output which changes during uncapping or capping motions on passing of a plunger (220) of the pen injector. This output is used together with at least one additional sensor output to determine the position of the plunger along a cylinder (210) of the liquid delivery device. By monitoring changes in the plunger position, the quantity of dosages delivered by the liquid delivery device can be determined, displayed, stored and/or transmitted to an external device for further data processing or storage.