Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2007
    Posts
    74
    Thanks
    3
    Thanked 2 Times in 2 Posts

    C++ -> What is the pressed key ?

    Hello to dear developers reading this message .

    I want to handle the Keypress event in C++ . I know C++ doesn't have handler but I can simulate it like this :

    while (condition)
    {
    char inputChar = What should I write here ?;
    if (inputChar == 'A')
    {
    // Program code goes here .
    }
    }

    I'll be waiting for solutions of you , the masters of C++ .

    Will be thankful to any help .

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Look into using getch() it will do what you want.
    OracleGuy


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •