Thread: a simple getch question

  1. #1
    Registered User
    Join Date
    Dec 2002
    Posts
    35

    a simple getch question

    I suppose i didnt understand what this means,

    The _getch function reads a single character from the console without echoing. _getche reads a single character from the console and echoes the character read. Neither function can be used to read CTRL+C. When reading a function key or an arrow key, _getch and _getche must be called twice; the first call returns 0 or 0xE0, and the second call returns the actual key code.
    how can be call twice? Does not means needs to wait for two press to work? Nevertheless, i can not catch arrow key.

    using BC++5.5(commandline free compiler) for dos.

    thanks
    Want to learn? Then try to teach...

  2. #2

  3. #3
    Registered User
    Join Date
    Dec 2002
    Posts
    35
    thank you i will check.
    Want to learn? Then try to teach...

  4. #4
    Registered User
    Join Date
    Dec 2002
    Posts
    35
    Thanks for this forum and surely people share their experiences.

    I am not writing here any code because tried every variation to test.

    I tried all experiences in forum i found(c/c++) but no success.

    My tests working on win95 but not work on my win98. So, that is not my fault, i think.

    My debug resulting only 0xE0 for arrow keys, on my Win98.

    I think two options to this,

    either win98 keyboard drivers problem, or maybe about my multimedia keyboard. Unfortunately i can not change my keyboard for test now.

    Did anybody experienced a problem with catching extended keys(arrows, home, pagedown) in DOS _getch()?

    Did anybody experienced such problem?

    thanks
    Want to learn? Then try to teach...

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Registered User
    Join Date
    Dec 2002
    Posts
    35
    Thank you Salem, but as i discussed my last post, i tried all of them in that link too(as others), even i mostly become hopeful in fact.

    I am already searching microsoft articles about this situation and find some articles about problems on either updates or config changes on system. But not tried yet.

    I am already suspicious on drivers. Because one of the test snippet on the thread which you point me is working on win95(other PC -my friend) but i can not change my keyboard or else. I think i am not the only people experiencing this problem.

    Problem is not about programming. That snippet is working in fact, but not on my machine.

    Thanks
    Want to learn? Then try to teach...

  7. #7
    Registered User
    Join Date
    Dec 2002
    Posts
    35
    I suppose my problem about, win98(not SE).

    Microsoft Knowledge Base Article - 214408 (Q214408)

    is explaining such problem. But is fixed in SE. Maybe somebody looks here in future. Must think this too.

    http://support.microsoft.com/default...b;en-us;214408
    Want to learn? Then try to teach...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple class question
    By 99atlantic in forum C++ Programming
    Replies: 6
    Last Post: 04-20-2005, 11:41 PM
  2. Simple question about pausing program
    By Noid in forum C Programming
    Replies: 14
    Last Post: 04-02-2005, 09:46 AM
  3. simple question.
    By InvariantLoop in forum Windows Programming
    Replies: 4
    Last Post: 01-31-2005, 12:15 PM
  4. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  5. simple fgets question
    By theweirdo in forum C Programming
    Replies: 7
    Last Post: 01-27-2002, 06:58 PM