i would like it to read if any key is being pressed for the time its pressed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <iostream>
usingnamespace std;
int main()
{
bool pressed = true;
while (true)
{
if (pressed)//any button pressed
{
printf("button has been pressed \n");// if a key is being held down
}
else
{
printf("button is not pressed \n");// if no button is held down
}
}
}