How do I read keyboard input in C++?
<p>Here is my attempt of moving a simple triangle drawn with DirectX 11 in C++:</p>
<pre><code>int DrawAndMovePlayer(Renderer renderer)
{
    Triangle triangle1(renderer);
    float p1, p2, p3, p4, p5, p6;
    float x, y;
    x = 0.0f;
    y = 0.0f;

    if (GetAsyncKeyState(0x58))
    {
        x = 1.0f;
    }

    // Top
    p1 = x + 0.0f;
    p2 = y + 0.05f;

    // Bottom Right
    p3 = x + 0.05f;
    p4 = y - 0.05f;

    // Top
    p5 = x - 0.05f;
    p6 = y - 0.05f;

    // Triangle triangle2(renderer);
    triangle1.draw(renderer, p1, p2, p3, p4, p5, p6);

    //triangle2.draw(renderer, -0.5f);
    return 0;
}
</code></pre>
<p>I have tried the <code>getch()</code> function and the <code>GetAsyncKeyState()</code> function. However, the triangle never changes its position. The triangle is drawn around a center point (<code>x</code>, <code>y</code>).</p>