Taking in user input without them having to press enter

I'm working on a simple side scrolling game in C++ and as it is you enter a command to move ie)'w' which increments a position in an array, then hit 'a' which makes the array print to the screen then press enter to actually give the program the command. How could i make everything update automatically over time and detect what button the user is holding down rather than them having to hit enter? It's kind of difficult for me to articulate this question but i think you understand what i mean :P

How difficult is it to do this? I am right now searching for an answer to this question on the internet but im just not sure what to search. Can anyone point me in the right direction?
You should check out Allegro. It's pretty cool and easy to learn.
Whatever the graphics library you use, it will provide a way to get individual keypresses (called unbuffered input).

Besides Allegro
http://alleg.sourceforge.net/

there is also SFML
http://www.sfml-dev.org/

and SDL
http://www.libsdl.org/

Good luck!
Topic archived. No new replies allowed.