Keyboard controller

Hi everyone, this is my first post (so please be gentle).

I recently got an Arduino uno, and would like to control some motors using my keyboard as the controller. I have code that allows me to control them by typing a word or letter and then hitting enter, but I was wondering if there was a way to add a real-time aspect to this. Is there any code that allows me to control a motor while a key is being pressed? For example, I press w and the motor moves, and keeps moving until I release w.

Any help would be appreciated, and if this question has been asked before I apologize.

Is there any code that allows me to control a motor while a key is being pressed?

Code for the Arduino? Or, code for the PC? You need an application on the PC that monitors key presses and releases. A press should sent on value, and release should send another value. Typically, this is done by sending a capital letter on press, 'W' for instance, and a lower case letter on release, 'w' for instance.

The Arduino side is pretty easy, then.

Are you using the Serial monitor for input or a separate terminal emulator ? The Serial monitor cannot do what you want but a terminal emulator should be able to, as would a program written specifically for the task.