API Input?

This is a discussion on API Input? within the C Programming forums, part of the General Programming Boards category; I want to start studing input that I can acutally use; but I don't know much or anything about it. ...

  1. #1
    Master n00b Matty_Alan's Avatar
    Join Date
    Jun 2007
    Location
    Bloody Australia Mate!
    Posts
    96

    API Input?

    I want to start studing input that I can acutally use; but I don't know much or anything about it. I herd that API input is what I should look into but I don't know what that is exactly. if someone could point me in a direction of any kind that would be great

    ~Matty-Alan~

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    You're asking for something extremely vague. Instead of having people guess what it is that you really want to do, I would suggest you be a little more specific with stating your intentions.

  3. #3
    Master n00b Matty_Alan's Avatar
    Join Date
    Jun 2007
    Location
    Bloody Australia Mate!
    Posts
    96
    Basicly what i'm looking for is someway to collect input continuesly without programs pausing at a getchar(); or equivilent event. something that i can start making games with that continue to play out even if there is nothing being entered.

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    Like this?
    Code:
    int c = 0;
    
    while(c != 27) {  /* or 0x1b: ESCAPE */
        if(kbhit()) {
            c = getch();
            printf("You entered '%c'\n", c);
        }
    
        printf("Processing . . .\n");
    }
    (For Dev-C++, try including <conio.h> and using getche() instead.)

    Also see http://faq.cprogramming.com/cgi-bin/...&id=1043284392

    Note that whatever non-buffered keyboard input you use will be non-standard.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. continues input
    By Matty_Alan in forum C Programming
    Replies: 2
    Last Post: 06-22-2007, 10:04 PM
  2. Input statement problem
    By une in forum C Programming
    Replies: 3
    Last Post: 05-29-2007, 11:16 PM
  3. For loop problems, input please.
    By xIcyx in forum C Programming
    Replies: 2
    Last Post: 04-22-2007, 03:54 AM
  4. FILES in WinAPI
    By Garfield in forum Windows Programming
    Replies: 46
    Last Post: 10-02-2003, 06:51 PM
  5. Help with Input Checking
    By Derek in forum C Programming
    Replies: 7
    Last Post: 06-17-2003, 03:07 AM

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