this is beyond your knowledge since you are a beginner.
start with something easier and build your knowledge gradually...
ThievingSix
If it's application specific and you need to be able to prevent a keylogger from knowing someones password they type into your application you could have the user use an on screen keyboard to type it.
To extend the remarks of ThievingSix...If you are providing a method for entering password data, consider user clicks on non-alphanumeric images. If you want to make this more secure, jumble the entry positions randomly.
You wouldn't need to worry about key loggers for password data if you captured the data with the arrow keys, space bar, Shift, and Enter keys. With scrambled positioning, the keylogger data couldn't be used to compromise the system.
Note: Any recorded information might be used in cryptanalysis, such as password length.
CodedK
Thats what the component i gave does
(The controls work by faking a random number of garbage keystrokes...).
aikimark
Be aware that there are hardware keyloggers that are undetectable with these software methods.
start with something easier and build your knowledge gradually...