He was probably inspired in part by Jack Sheppard who, like Macheath, escaped from prison and enjoyed the affections of a prostitute, and despised violence.
In Charles Dickens' novel, Little Dorrit, he is quoted by Bar, a lawyer attending a dinner party held by Mr. Merdle: "a high and solemn occasion, when, as Captain Macheath says, 'the judges are met: a terrible show!'
Nevertheless, I think I could put in evidence an admission of the Captain's,' said Bar, with a little jocose roll of his head; for, in his legal current of speech, he always assumed the air of rallying himself with the best grace in the world; 'an admission of the Captain's that Law, in the gross, is at least intended to be impartial.
For what says the Captain, if I quote him correctly—and if not,' with a light-comedy touch of his double eye-glass on his companion's shoulder, 'my learned friend will set me right: 'Since laws were made for every degree, To curb vice in others as well as in me, I wonder we ha'n't better company Upon Tyburn Tree!
'"[3] In Bertolt Brecht's The Threepenny Opera, he is referred to as "Mack the Knife", and is the subject of the song of the same name.