checking for any key

This is a discussion on checking for any key within the C Programming forums, part of the General Programming Boards category; hi there, haven't been here in a long time. I have been using Borlands 5.5 getch() in conio.h which returnes ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    31

    checking for any key

    hi there, haven't been here in a long time.

    I have been using Borlands 5.5 getch() in conio.h which returnes a keycode to check what key was pressed.
    How do I check if any key was pressed?Is that in the same function ?

    For Example i want to make a loop to process some output until the user pressed any key. It should not stop and wait each time to check what key was pressed.

  2. #2
    Wannabe Coding God
    Join Date
    Mar 2003
    Posts
    259
    if I'm not mistaken getch returns err when there's no key being pressed... if it is like that you could use it in the loop just cheaking for it to change from err
    They say that if you play a Windows Install CD backwords, you hear satanic messages. That's nothing; play it forward and it installs Windows.

  3. #3
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    I'd recommend looking at the kbhit() function.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Virtual keys
    By Arkanos in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2005, 10:00 AM
  2. Problems about gcc installation
    By kevin_cat in forum Linux Programming
    Replies: 4
    Last Post: 08-09-2005, 10:05 AM
  3. Directional Keys - Useing in Console
    By RoD in forum C++ Programming
    Replies: 38
    Last Post: 10-06-2002, 05:42 PM
  4. FAQ: Directional Keys - Useing in Console
    By RoD in forum FAQ Board
    Replies: 38
    Last Post: 10-06-2002, 05:42 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21