Thread: Immediately responding to keypresses?

  1. #1
    Registered User blackwyvern's Avatar
    Join Date
    Jan 2002

    Immediately responding to keypresses?

    I have looked in two different sources, Jasma's C++ bible and learning c++ in 21 days and I cant get an answer, though I read you can do ti with windows programming(I have yet to figure out how to construct a window and implement graphics or text...Im reading many tutorials about OpenGL.) Anyway, back to the question at hand. In a console application I am tired of having the user press 1 then hit enter for the program to register the requested action. Is there anyway I can make my program automatically return 1 when the user presses 1 without hitting enter? Thanks in advance for any help on this.

  2. #2
    ¡Amo fútbol!
    Join Date
    Dec 2001
    getch() or _getch()//not all compilers have it and does not echo output to screen

    getche() or _getche()//again not all compilers have it and does echo output to screen

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 07-08-2005, 07:44 AM
  2. Not Responding
    By osal in forum Windows Programming
    Replies: 0
    Last Post: 07-15-2004, 11:43 AM
  3. (Not Responding)
    By Mithoric in forum Windows Programming
    Replies: 1
    Last Post: 06-26-2004, 09:12 AM
  4. Replies: 0
    Last Post: 12-16-2001, 10:36 AM