Before going down this path, see if there is a way to register to recive key pressed events that gives you what you need. What you are doing is called polling, and it ALWAYS slows a computer down. To get around it computers have interupts of various sorts so that you can be told that something happened. So you have something like: while(someWaitForKeyEvent()) { if(GetKeyState(VK_SHIFT) == 1) ..code.. Assuming you have to poll I'd do it something like: while (1 != (result = GetKeyState(VK_SHIFT)) { sleep(1); // wait one second before polling again } ..code.. lookup sleep (including other forms of it like BSleep), see if there is one that will yield the rest of your CPU cycles to other tasks. I suspect sleep(1) is too long so you will want, so find something that does the same thing, but for less time. Basicly what is happening is you can run GetKeyState several hundred times in your timeslot, but you can call GetKeyState a lot faster than a human could press the keyboard. (look up debouncing sometime, it is taken care of for you, but it will help you see what is going on) So you are looking for a way to tell the computer "I won't be able to do anything for a while, do something else" One last point: instead of if(result == 1) you should use a constant or an enumeration so you can do if(result == KEY_DOWN) this makes it clearer to readers what you mean. As you wrote you code I'm not sure what it means, while KEY_DOWN tells me something. (There might even be defined constants in a headerfile someplace. When I first saw your code I was thinking of key as in encryption key, and figured you were waiting on a thread to generate the key! It took me a minute to realise that it was a windows function and then I had to look it up to see what it did)