So this can be performed;
Does your Arduino have a keyboard attached? Mine doesn't.
The keyboard is attached to some other device. That device needs to tell the Arduino that a key was pressed.
That device being a PC, it is dumb as a box of rocks. You need to write an application, and run it, that detects key presses and sends them, via the serial port, to the Arduino.
The Arduino needs to read serial data, and do something with it.
I'd guess that there are something in the neighborhood of about 14 bazillion examples around.