Think of the key of C. In that key, the notes are CDEFGAB. You can start that first C on ANY C on the whole fretboard. Not just the 8th fret of the 6th string. Getting a little more complex, you don't even have to use the C, but you can still be in the key of C by playing something with the other notes. Or go into different modes.
In terms of chords, the Major sequence is:
Maj min min Maj Maj min dim
Cmaj Dmin Emin Fmaj Gmaj Amin Bdim
There are a ton of factors that goes into defining the key. Not 1 note or 1 string.
When thinking of keys (and things like scales or different modes), think of them in terms of their sound. Something in the key of C will have a unique sound because of the notes used in that key, compared to something in the key of A that has different notes used in it.