as i use it, 'playing in a key' means to play using only the notes of that key, whether alone, in intervals of 2 notes, or in chords of 3 or more notes ...
so the notes of the key of C are C D E F G A B ... no sharps, no flats ... if you make chords from those notes (harmonized in 3rds, for a most common example) you would get the chords C major, D minor, E minor, F major, G major, A minor, and B diminished ... so a song in the key of C would use those chords ... you can also add the next note to those chords to get 'jazzier' chords .. C major 7, D minor 7, E minor 7, F major 7, G (dominant) 7, A minor 7, or B half diminished (-7b5) ...
now, work an example or two out for yourself to find the notes / chords of the other keys .. start with G (1 sharp) and F (1 flat)
thats really all there is to playing in a key, in its most basic sense
hope this helps
t4d