Thread: keyhit problem

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    224

    keyhit problem

    what header do i need to use the keyhit, RIGHT, LEFT, UP, and DOWN keywords

  2. #2
    Unregistered
    Guest
    Never heard of keyhit. I have heard of kbhit() found in the conio.h.

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    224
    ok could i use it like this

    if(kbhit==RIGHT)...
    or would it be
    if(kbhit(RIGHT))...

    and what do i need to use the identifiers RIGHT LEFT DOWN UP...

    some one please take the time to help
    Last edited by c++.prog.newbie; 12-23-2001 at 09:00 PM.

  4. #4
    Registered User
    Join Date
    Aug 2001
    Posts
    223
    Cut the following code to see if you have got what you need. It is a small sample of how kbhit works.

    #include <iostream.h>
    #include <conio.h>



    void main( void )
    {

    int i;

    //75 72 77 80
    while( 1 )
    {
    while( !kbhit() )
    {

    }

    i = getch();
    cout << "\nLast key hit has number code: " << i << endl;
    }
    }
    zMan

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM