How do I reduce input lag in an NCurses C Application
<p>I am getting major amounts of input lag when I run my application.</p>

<p>More details:
When I press 'w', 'a', 's', 'd' (My assigned input keys) the object moves however it continues to move for an extended period of time after the key has been released. The source code is below however small parts of the code have been cut out to shorten the questions however if the source code below does not compile I have all of the code up on github.
<a href="https://github.com/TreeStain/DodgeLinuxGame.git" rel="nofollow">https://github.com/TreeStain/DodgeLinuxGame.git</a> Thankyou for your time. -Tristan</p>

<p>dodge.c:</p>

<pre><code>#define ASPECT_RATIO_X 2
#define ASPECT_RATIO_Y 1
#define FRAMES_PER_SECOND 60

#include &lt;ncurses.h&gt;
#include "object.h"
#include "render.h"

int main()
{
    initscr();
    cbreak();
    noecho();
    nodelay(stdscr, 1);

    object objs[1];

    object colObj; colObj.x = 10; colObj.y = 6;
                   colObj.w = 2;  colObj.h = 2;
                   colObj.sprite = '*';
                   colObj.ySpeed = 1;
                   colObj.xSpeed = 1;

    objs[0] = colObj;

    //halfdelay(1);

    while (1)
    {
        char in = getch();
        if (in == 'w')
            objs[0].y -= objs[0].ySpeed * ASPECT_RATIO_Y;
        if (in == 's')
            objs[0].y += objs[0].ySpeed * ASPECT_RATIO_Y;
        if (in == 'a')
            objs[0].x -= objs[0].xSpeed * ASPECT_RATIO_X;
        if (in == 'd')
            objs[0].x += objs[0].xSpeed * ASPECT_RATIO_X;
        render(objs, 1);
        napms(FRAMES_PER_SECOND);
    }

    getch();

    endwin();
    return 0;
 }
</code></pre>

<p>render.h:</p>

<pre><code>void render(object obj[], int objectNum);

void render(object obj[], int objectNum)            //Takes array of objects and prints them to screen
 {
    int x, y, i, scrWidth, scrHeight;
    getmaxyx(stdscr, scrHeight, scrWidth);          //Get terminal height and width

    for (y = 0; y &lt; scrHeight; y++)
    {
        for (x = 0; x &lt; scrWidth; x++)
        {
            mvprintw(y, x, " ");
        }
    }

    for (i = 0; i &lt; objectNum; i++)
    {
        int xprint = 0, yprint = 0;
        for (yprint = obj[i].y; yprint &lt; obj[i].y + (obj[i].h * ASPECT_RATIO_Y); yprint++)
        {
            for (xprint = obj[i].x; xprint &lt; obj[i].x + (obj[i].w * ASPECT_RATIO_X); xprint++)
                mvprintw(yprint, xprint, "%c", obj[i].sprite);
        }
    }
    refresh();
}
</code></pre>

<p>object.h:</p>

<pre><code>typedef struct
{
    int x, y, w, h, ySpeed, xSpeed;
    char sprite;
}object;
</code></pre>

<p>P.S. please feel free to critique my methods and code as I am fairly new at programming and can take all the criticism I can get.</p>