Let me give context.
I'm writing a program that uses JFugue, and I want it to loop a particular pattern over and over again until the user presses a key on the keyboard (anyone not familiar with JFugue: play a tune over and over again).
Now, I'm using keylisteners like a good programmer, now, the problem is how can I tell the loop to keep going until a keyevent is received by the listener? I've been looking for an answer pretty well everyone and haven't found anything close to this dilemma. I'm getting many "take input until someone types 'quit'" kind of problems, which I know how to code, but that isn't what I am looking for. The program isn't waiting for input before doing something, its doing something until it receives input.
Any ideas?