For the life of me I cannot find any help with this on the internet. My goal is to write a function that happens when shift is held and a mouse is clicked on the application. Right now I am just focusing on shift.
I have this class:
public void keyPressed(KeyEvent e)
{
if (e.isShiftDown())
{
//Do Something
}
}
Then in my main class I guessed at what I thought might work and it failed.
KeyEvent e = new KeyEvent;
keyPressed(e);
With this error:
KeyEvent cannot be resolved to a variable
I have seen examples that have this very line of code. So I'm stuck. My knowledge of Java is too limited for me to have any ideas.
Any help is appreciated.