How to scan for keypresses?

This is a discussion on How to scan for keypresses? within the Linux Programming forums, part of the Platform Specific Boards category; All I need to explore a plethora of possibilities is to know how on earth to scan for keypresses? I ...

  1. #1
    Unregistered
    Guest

    Question How to scan for keypresses?

    All I need to explore a plethora of possibilities is to know how on earth to scan for keypresses?

    I mean sort of like

    while(1) {
    if (keypressed)
    move(UP);
    }

    ...so I can make realtime games/apps.

    Is this included in ncurses?

  2. #2
    Registered User
    Join Date
    Jul 2002
    Posts
    47

    Did Not Work

    It says that STDIN_FILENO is undeclared function. HELP
    Im using G++ compiler

  3. #3
    Im back! shaik786's Avatar
    Join Date
    Jun 2002
    Location
    Bangalore, India
    Posts
    345
    STDIN_FILENO is the file descriptor of your terminal you are manipulating. This is usually 0 for your terminal.

  4. #4
    Registered User
    Join Date
    Jul 2002
    Posts
    47
    Ok Im using this kbhit function that was made here, but there is one problem. Rather than just returning true or false if a key was hit it just stays there and waits in the function freezing up the program until a key is pressed. HELP PLEASE

  5. #5
    Registered User
    Join Date
    Jul 2002
    Posts
    47
    Ive determined I want to use forks. How do I use them. I am having trouble finding information on them. Fork()
    Please help

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. scan multiple items in multidimensional array
    By requiem in forum C Programming
    Replies: 1
    Last Post: 04-17-2003, 03:02 PM
  2. while (scan != 'y' or 'n) or if(scan != 'y' or 'n)
    By Blizzarddog in forum C++ Programming
    Replies: 6
    Last Post: 10-23-2002, 01:16 PM
  3. about scan 7-segment display via parallel port
    By mobdawg in forum C Programming
    Replies: 4
    Last Post: 09-11-2002, 06:11 AM
  4. Scan data from file
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 05-12-2002, 07:52 AM
  5. Replies: 0
    Last Post: 02-21-2002, 05:05 PM

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