Here is a possible example of what I am trying to do.
if (/* the user presses Alt+e*/) {
Process a = Runtime
.getRuntime()
.exec("rundll32 url.dll,FileProtocolHandler C:\\blah\\blah\\blah\\abc.bat");
a.waitFor();
// or something else
}
The above code is meant to run a file abc.bat if the user presses Alt+e. I can't figure out what to put in the "if" statement. The "then" part of the code is not relevant to the question here, it is just an example. I am new to Java and I googled a lot before asking this question but anything I found that seemed relevant contained terms and statements that I couldn't understand in the explanation of the code mentioned there which made me suspect that it was about something different than what I am trying to do, so can anyone please help me here with the required code to put inside the "if" and perhaps explain it also in easy English. And if if-then-else is not the way to this then I am open to other solutions.