I have been searching for an answer for my problem for a while now, but I can't seem to find an existing question on the topic.
I am creating a voice chat program with Java for private use in gaming. The only problem is that it would be very painful to swap windows every time you want to talk (the program is required to be push to talk only). So, I need to be able to have a key bind for activating the voice transmission while using another application; Java needs to be in the background (not the window under focus). I have not found any answers that work with a non-focused window.
Any help will be appreciated!