Getting input in a command line app.

Gavin Williams 761 Reputation points
2021-05-06T11:30:03.487+00:00

Hi,

I have a C++ command line app, but I want to get away from cin, and scanf and all that style of API.

How can I access keyboard input the way I would for a CoreWindow for example.

Developer technologies | C++
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Gavin Williams 761 Reputation points
    2021-05-06T11:47:26.717+00:00

    This page has some info on changing the command lines input mode...

    https://iq.direct/blog/325-how-to-read-direct-mouse-and-keyboard-events-in-c-console-app.html

    Very legacy, but it's a start.

    0 comments No comments

  2. Sam of Simple Samples 5,546 Reputation points
    2021-05-06T17:59:22.513+00:00

    Windows Terminal: Microsoft's next console for all command lines | 4sysops says we can use Console Virtual Terminal Sequences. If so then you have the ability to create quite sophisticated console programs.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.