The keys you've been playing aren't all twelve notes. They're seven of them, picked so they fit together. That set of notes is called a scale, and it's why nothing you played sounded wrong.
Your song has been in a minor scale. Next you'll hear what happens when you switch it.