Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. key press

key press

Scheduled Pinned Locked Moved C / C++ / MFC
helptutoriallearningworkspace
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Newborn Naughtysaint
    wrote on last edited by
    #1

    help me how to use key press function in C programming at DOS 16-bit environment. i mean just like: if (press Delete on keyboard) { ....process.... } thousands thanks :) >>teaching is also learning<<

    X J 2 Replies Last reply
    0
    • N Newborn Naughtysaint

      help me how to use key press function in C programming at DOS 16-bit environment. i mean just like: if (press Delete on keyboard) { ....process.... } thousands thanks :) >>teaching is also learning<<

      X Offline
      X Offline
      Xander80
      wrote on last edited by
      #2

      I found something, but I don't know if it's usefull. MSDN: _getch Requirements _getch <conio.h> Win 98, Win Me, Win NT, Win 2000, Win XP Return Value Returns the character read. There is no error return. Remarks The _getch and _getwch functions read a single character from the console without echoing. _getche and _getwche read a single character from the console and echo the character read. None of these functions can be used to read CTRL+C. When reading a function key or an arrow key, each function must be called twice; the first call returns 0 or 0xE0, and the second call returns the actual key code. That would make: char ch; ch = _getch(); ch = _getch(); //each function has to be called twice to read function or arrow keys Don't forget: #include <conio.h>

      1 Reply Last reply
      0
      • N Newborn Naughtysaint

        help me how to use key press function in C programming at DOS 16-bit environment. i mean just like: if (press Delete on keyboard) { ....process.... } thousands thanks :) >>teaching is also learning<<

        J Offline
        J Offline
        John M Drescher
        wrote on last edited by
        #3

        You are programming for DOS. What is that?? ;P Just kidding. I have not worked with a complier that would produce DOS code in the last 7 years... The stuff about _getch() that Xander80 said should work in dos. John

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups