Wow, you learn something new every day! Didn't know that. So Key appropriated the tune and here I thought all these years he made it up along with the words.
Nope. He practiced an age old policy of the US Government, he wanted it so he took it.