Skip to content

Keyboard input #2296

@jsfan3

Description

@jsfan3

In the previous discussion #2295, I had asked in item 2:

Is there support (or a recommended approach) for capturing keyboard input and echoing it back to the screen?

I am moving the discussion on this issue here so as not to put multiple issues in the same thread.

I tried this code:

#include <iostream>
#include <string>
#include <os>

int main() {
    std::cout << "Insert a text: ";
    std::string input;
    std::getline(std::cin, input);
    std::cout << "You wrote: " << input << "\n";
    os::shutdown();
    return 0;
}

Unfortunately, the input request did not work. This is the result:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions