School project

Me and my friend is going to make an examination project in programming 1 (c++). So we decided to make a program that makes different sounds (beep) depending on which button on the keybord you press. You could say that it's kind of like a piano. We will make with the beep-function and different if- and else- or switch-cases. We're wondering if you have any tips on how to make the beep last as long as you have the button pressed down? Or do you have any other tips in general that make the program better (less bad)?
Thanks for fast answers!
Standard C/C++ doesn't provide enough functionality for this. So you have to use system dependant functions.

Under windows you can use messages like this:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms646276%28v=vs.85%29.aspx

Or keyboard input functions:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms645530%28v=vs.85%29.aspx


With this you can determine whether a key is pressed or released.
Topic archived. No new replies allowed.