Results 1 to 5 of 5

Thread: Keypress event in C++

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2019
    Posts
    21

    Keypress event in C++

    Please how can I get a character if a key is press on a keyboard in c++ using visual studio. for example if s or S is press, the character pressed should be output in a message box.

  2. #2
    Fanatic Member 2kaud's Avatar
    Join Date
    May 2014
    Location
    England
    Posts
    670

    Re: Keypress event in C++

    Is this a console, WIN32, MFC, other program?
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++17 Compiler: Microsoft VS2019 (16.6.3)

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2019
    Posts
    21

    Re: Keypress event in C++

    Please am working on window form application

  4. #4
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    35,024

    Re: Keypress event in C++

    Windows Forms doesn't sound like C++ at all. It sounds like C#, or perhaps the .NET based C++/CLI. If it is one of those, I can move the thread.
    My usual boring signature: Nothing

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jul 2019
    Posts
    21

    Re: Keypress event in C++

    yes please

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width