I want it to constantly run something UNTIL it receives a keypress like this

Code:
for ( ;; )
{   
     Beep(x,10);
     _getch();
}
except that WAITS for the keypress before continuing with the loop. I need it to loop until it gets a keypress, effectively constantly beeping until a keypress. Basically, the keypresses will change the value of x, allowing the user to change the pitch.

Can anyone please help me?