Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Hold Key Function In C++

Name: Anonymous 2007-11-20 5:57

I'm trying to make a function in C++ that when the button is not held down, there is a blank box in the display, but while the button is held down the box is gone and something else is displayed, in this case the number 1.

This is what I have.
What happens is, when the key is pressed the number one is displayed, but when it is released the one doesn't go away, and the char(219) isn't displayed

cout<<char(219);
int flag=0;
while(!_kbhit()){}
while(_kbhit())
{
    if(flag==0)
    {
        system("cls");
        cout<<"1";
        flag++;
        }
}
system("cls");
cout<<char(219);

Name: Anonymous 2007-11-20 6:08

system("cls") ..?

Is this some sort of joke?

Name: Anonymous 2007-11-20 6:09

Whats wrong with system("cls")?

Name: Anonymous 2007-11-20 6:15

You're an idiot.

Name: Anonymous 2007-11-20 6:18

It clears the screen! I need to clear the screen for this to work.

Name: Anonymous 2007-11-20 6:38

>>5
Use libclear then.

Name: Anonymous 2007-11-20 6:42

But thats won't solve my problem, will it?

Name: Anonymous 2007-11-20 6:50

>>7
WHO CARES ABOUT YOUR GODDAMN PROBLEM? THIS IS /PROOOOOOOOOOOOOOOOOOOOOOOOOOOOOG/!

Name: Anonymous 2007-11-20 6:52

Its a programming problem...
Guess you can't help then?

Name: Anonymous 2007-11-20 7:16

>>9
No, I'm afraid not.

1. You fuqin angered an expert programmer.
2. Abstract bullshite.
3. Read SICP.

Name: Anonymous 2007-11-20 7:37

>>5
Learn proper console programming you useless piece of yellow shoe-turd

Name: Anonymous 2010-11-26 9:33

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List