reading the keyboard

This is a discussion on reading the keyboard within the C++ Programming forums, part of the General Programming Boards category; is there a way to read if the keyboard is being pressed and if so which key is being pressed ...

  1. #1
    Unregistered
    Guest

    reading the keyboard

    is there a way to read if the keyboard is being pressed and if so which key is being pressed without halting untill a key is pressed? sort of like getch() but without stopping the program untill a key is pressed. im working under borland 5 in a dos environment

  2. #2
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    you could call a function that checks for input for a set period then passes back to program control if it recieves nothing in that time
    Monday - what a way to spend a seventh of your life

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    104
    Huh, in MFC it is the WM_CHAR message... but in DOS- I have no idea...

    probably kbhit()...?
    Ilia Yordanov,
    http://www.cpp-home.com ; C++ Resources

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Keyboard port using other that a keyboard
    By antoinelac in forum C++ Programming
    Replies: 4
    Last Post: 06-12-2008, 03:46 PM
  2. Reading data into a 2D array
    By swgh in forum C Programming
    Replies: 2
    Last Post: 08-17-2007, 04:07 AM
  3. help with reading from stream
    By movl0x1 in forum C Programming
    Replies: 7
    Last Post: 05-31-2007, 11:36 PM
  4. Fun with reading hex
    By dpro in forum C++ Programming
    Replies: 7
    Last Post: 02-17-2006, 06:41 PM
  5. Reading an input from the keyboard
    By thetinman in forum C Programming
    Replies: 4
    Last Post: 01-21-2006, 03:31 PM

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