Need help with constant movement

Hi everyone! I wanted to ask you guys a question. I was referred to this website by a friend of mine and I synced this account with my Facebook. I am new to computer programming, but I understand the beginning basics of C++ (i.e. cin, cout, void, float, vector, functions, structures, and so on). I am having difficult making a Snake/Tron-like game, which is why I am going to you guys. So here is my question: How can I make it to where a piece of mine keeps moving while a key is not held down / clicked? I have tried different ways, including the do this while (movement == KEYEVENTF_KEYUP); I need some help and it would really help me if I can get this accomplished.

Basically you should keep movement state in one separate variable and only touch it when movement affecting keys have been pressed. So you move not only when key is pressed but every tick and key pushed conditions only change the movement variable.