What influenced Francis Scott Key?

Francis Scott Key's poem "Defence of Fort M'Henry" was inspired by the Battle of Baltimore in the War of 1812. The poem's lyrics were written in such a way that they would match the rhythm of the song "To Anacreon in Heaven," which together make up the Star-Spangled Banner, the US national anthem.