question

DeadStack avatar image
0 Votes"
DeadStack asked RoyLi-MSFT edited

Getting input in a command line app.

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.

c++
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DeadStack avatar image
0 Votes"
DeadStack answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SimpleSamples avatar image
0 Votes"
SimpleSamples answered SimpleSamples edited

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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.