How to write a java program that runs in background but still can detect any key press from the keyboard (with the corresponding keycode)

Recommended Answers

All 9 Replies

See the thread on the other forum where you posted this question.

The program you want to do looks like a keylogger to me...

@Taywin.. you are right..

It may be keylogger..but leave that aside...

I have the same question from long time.. How can we make a java program listen to our keystrokes without any window.
As all of us know we can add keylistener to frame or any window. But is it POSSIBLE in java to make it listen the keystrokes without registering to frame or any component..(intention may be to make keylogger or whatever . its secondary thing)..

I know that it is NOT possible..(as far as i know)..
Are there any nerds who says POSSIBLE....

Waiting for replies......

My favourate language doesn't help me to make Keylogger..
Should i shift to other language just to make a silly keylogger..
No way.:)
But i'll look out traditional languages(C/C++)..:)

Correct, the behavior is keylogger but Java is too obvious to make a keylogger. You need a lower level language for it. C/C++ would be good for. Though, it would be OK if you are curious and want to learn, but nothing else ;)

And even were it possible, it'd be unethical and possibly illegal for anyone to help you write one. Keyloggers are used almost exclusively in malware, thus the only conclusion we can come to is that you're trying to write malware.

commented: don't see why this should be downvoted. simple facts. +14

Well, I was googling the same, but in my case it is that I want my program to catch a special keyboard combination triggering an event (such as in teamspeak where you have to press a special key-combination to make it mute your microphone etc...)

Is that when one of your windows has the focus, or is it the same as the original question?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.