Getting keyEvents even though the program is not in focus
So, I'm currently working on a nifty little tool for myself and the only thing from completing it is this little thing ;p
What I need it to do is that whenever I press a key, regardless if the program is in focus or not, it should do a certain thing. I've got all of the code done, working, but as of right now I'm using a button instead of this KeyListener.
I tried to do it by making the app go into the system tray but unfortunately I got an unexpected error and didnt really feel like sorting that out.
I've googled for an answer but couldnt find anything.
Could someone help me with this? or point out the general direction on how to do it? Is it even possible to do in Java?
thanks in advance.