Thread: how do i monitor keyboard input w/o stopping execution, i.e. getche()

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    4

    Question how do i monitor keyboard input w/o stopping execution, i.e. getche()

    in QBasic you can check a variable called inkey which records any key pressed no matter what else the program is doing... the input functions in c++, getche(), scanf() etc all stop program execution to record input...
    at least those i have seen so far...
    so i need to know how to get keyboard input without stopping program

    i am making a game and i just finished the timer, then realized it would not work w/o this...

    example:
    (prints location description, starts timer, random chance to meet enemy every second, also checking keyboard for keys)

    if anyone could offer help i would greatly appreciate it.

  2. #2
    Registered User
    Join Date
    Oct 2002
    Posts
    4

    Lightbulb hey nevermind i got it thnx anyway

    stupid me, finally read FAQ, found kbhit() so im okay now but ill have more questions!

  3. #3
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    ill have more questions!
    Well, make sure you read over the FAQ really well, and there is, also, the search function (look up at the top right corner of your screen and you will be able to find the search tab). This is all just for future reference of course.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. About aes
    By gumit in forum C Programming
    Replies: 13
    Last Post: 10-24-2006, 03:42 PM
  2. bizarre anomaly in input loop with getche()
    By Dragaard in forum C++ Programming
    Replies: 2
    Last Post: 04-14-2006, 02:12 PM
  3. reading input w/o hitting enter?
    By Aalmaron in forum C Programming
    Replies: 1
    Last Post: 01-31-2006, 10:38 PM
  4. Trouble with a lab
    By michael- in forum C Programming
    Replies: 18
    Last Post: 12-06-2005, 11:28 PM
  5. Stopping input with CTRL+D
    By SirKnightTG in forum Linux Programming
    Replies: 4
    Last Post: 09-20-2003, 11:58 AM