Thread: kbhit() and getch() Equivalent..

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    66

    kbhit() and getch() Equivalent..

    I'm trying to create a control function for my program that can simulate the kbhit() and getch() combination, it should be using standard C and windows API without using any external libraries. Can anyone give me suggestions how to do this?

    I tried using GetAsyncKeyState() and ReadConsoleInput() but it doesn't work like exactly as I want them.

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Because it is windows specific - It should be in Windows forum

    You should post your code, explain what it does and how it is different from what you expect
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. kbhit() for enter key? not working
    By yahn in forum C++ Programming
    Replies: 4
    Last Post: 04-03-2006, 02:44 AM
  2. Replies: 5
    Last Post: 11-26-2002, 10:34 PM
  3. Pausing for input, with kbhit() still detecting keys
    By Da-Spit in forum C++ Programming
    Replies: 5
    Last Post: 05-23-2002, 05:04 AM
  4. Getting the char from kbhit()
    By CodeMonkey in forum C++ Programming
    Replies: 5
    Last Post: 03-24-2002, 11:10 AM
  5. Making a getch and kbhit function?
    By Brian in forum C Programming
    Replies: 2
    Last Post: 03-03-2002, 11:50 AM