An injection device (100) comprises: a needle insertion mechanism (111); a medicament delivery arrangement (123) configured to cause injection of a medicament into a patient; and a cavity (102) having an opening (103) for receiving a key device (104). The injection device is configured to respond to detecting the presence of the key device in the cavity by triggering operation of the injection device. The specification also provides a method of controlling an injection device (100) including a needle insertion mechanism (111); a medicament delivery arrangement (123) configured to cause injection of a medicament into a patient; and a cavity (102) having an opening (103) for receiving a key device (104), the method comprising: responding to detecting the presence of the key device in the cavity by triggering operation of the injection device.