how to turn arduino into a controller for pc?

is there a way to use a aplication(like a java code or something) to read the text from the serial monitor and then register it as a keyboard imput?
I think it would be perfect but i dont quite understand arduino so far...