I am basically building a vileplume in openGL. Ignore all of my code expect the doMainLoop and Keyboard function.Because my problem is when the user press 'j' to jump , the charcter would just keeps moving up without stopping. I have write a direction to stop after a certain limit but somehow could not work. Any1 tell me what is wrong with it.

Switch statements don't work quite the way you think they do, I believe.

The case blocks operate more like a goto than an if/else statement (given a small range of possible values, your compiler might use a jump table), and as such, stuff outside of a case/break block isn't going to get executed. That is, control flow jumps from the switch's condition (in this case, key) straight to the appropriate case statement, then executes until it hits a break, or the switch statement ends.
In the case of a break, the program jumps out of the switch statement immediately.

Seriously, i spend 2-3 hours trying to move the object from the top before going to bottom. But. somehow, the code could not work. I had completely no idea what should I do for the animation. Please help me.

Ok, nvm, i make it to move from top and back to middle. Nut the problem is I can copy press J once to move from top and back to the original postiion. I want to make it move from top and back to the original position if the user press J instead of just doing it once