2007-03-29 23:21:00 +00:00
|
|
|
package ei.game.input;
|
|
|
|
|
|
2007-04-28 22:09:39 +00:00
|
|
|
import org.lwjgl.input.Keyboard;
|
|
|
|
|
|
|
|
|
|
import ei.engine.LWJGLGameWindow;
|
|
|
|
|
import ei.engine.input.KeyboardInput;
|
|
|
|
|
import ei.engine.state.GameStateManager;
|
|
|
|
|
|
|
|
|
|
public class InGameKeyboardInput extends KeyboardInput{
|
|
|
|
|
|
|
|
|
|
public InGameKeyboardInput() {
|
|
|
|
|
super("InGameKeyboardInput");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void keyDown(int keycode) {
|
|
|
|
|
if (Keyboard.KEY_ESCAPE == keycode) {
|
|
|
|
|
if(GameStateManager.getInstance().getState("MenuState") != null){
|
|
|
|
|
GameStateManager.getInstance().setDeActive("InGameState");
|
|
|
|
|
GameStateManager.getInstance().setActive("MenuState");
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
LWJGLGameWindow.exit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void keyUp(int keycode) {}
|
2007-03-29 23:21:00 +00:00
|
|
|
|
|
|
|
|
}
|