at the age of 22, keir joined the army and was commissioned into the 61st regiment (now the gloucestershire regiment). during the seven years' war he was stationed with his regiment in the west indies. he became lieutenant on, 31 march 1759, captain-lieutenant on 16 may 1766, and captain on 23 june of the same year.