I am trying to detect when the shift key (either side) is held down by the user (without pressing any other keys), but I can't figure out to do this. This is the only thing I found to detect pressing a shift key:
protected boolean keyStatus(int keycode, int time)
{
System.out.println("down");
boolean retVal = false;
int key = Keypad.key(keycode);
if( key == Keypad.KEY_SHIFT_LEFT )
{
// do something
retVal = true;
}
else if( key == Keypad.KEY_SHIFT_RIGHT )
{
// do something
retVal = true;
}
return retVal;
}
Shift doesn't trigger keyDown and keyUp, which would have been ideal. What am I missing?