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.L'invention concerne un dispositif d'injection (100) qui comprend : un mécanisme d'insertion d'aiguille (111); un agencement d'administration de médicament (123) conçu pour provoquer l'injection d'un médicament dans un patient; et une cavité (102) comportant une ouverture (103) pour recevoir un dispositif formant clé (104). Le dispositif d'injection est conçu pour répondre à la détection de la présence du dispositif formant clé dans la cavité par opération de déclenchement du dispositif d'injection. L'invention concerne également un procédé de commande d'un dispositif d'injection (100) comprenant un mécanisme d'insertion d'aiguille (111); un agencement d'administration de médicament (123) conçu pour provoquer l'injection d'un médicament dans un patient; et une cavité (102) comportant une ouverture (103) pour recevoir un dispositif formant clé (104), le procédé consistant à : répondre à la détection de la présence du dispositif formant clé dans la cavité par opération de déclenchement du dispositif d'injection.