Separate events from actions. You should refactor you code the way you have three separate things: key up/down event, visual feedback of a key: pushed and normal state, which lighted key being optional, sound effect of the key: start/stop playing a note.
Don't hard code the two key action in the event handler, make them separate method. This way, you can call them from different places: for example, from the key handler and from the played sequence.
In two words, use
loose coupling, see
http://en.wikipedia.org/wiki/Loose_coupling[
^].
Now, what do you stream in the play sequence, just notes? Or you can add extra information which would denote keys? No matter, there is one-to-one correspondence between keys and notes (musical tones), so finding a key from a recorded sequence is not a problem at all.
—SA