Beeping function duration determined by key-pressed event

Hello, I'm currently learning C++ through Dev C++, and I'm working on an programme which with keyboard inputs generates sounds of different frequencies(music on computer keyboard)
I assigned each key on the keyboard to a beep of a certain frequency using beep (frequency, delay). But is there a way where if I long press a key, the sound goes on infinitely until I release the key?

I've searched online and found the function WM_KEYDOWN, but I'm not sure how I'm suppose to use it.






Topic archived. No new replies allowed.