samedi 13 février 2021

ESC press without delete whatever I just type in CIN function

I have this code

while (true)
{
    cout << "Start typing: ";
    cin >> input;
    if (GetAsyncKeyState(VK_ESCAPE))
    {
        for (char& eachChar : input)
        {
            node = InitiateNode(eachChar);
            LinkedListAddData(linkedList, node);
        }
        cout << "You type: " << endl;
        PrintLinkedList(linkedList);
        break;
    }
}

I have problem like this. When I was in the cin typing function. Whenever I press ESC, it delete what I just type: For example: I type ABC, I press ESC it delete ABC. I don't want that. I want after I type ABC then I press ESC it run the code when I press the ESC.

Aucun commentaire:

Enregistrer un commentaire