本文整理汇总了Java中com.badlogic.gdx.Input.Keys.UP属性的典型用法代码示例。如果您正苦于以下问题:Java Keys.UP属性的具体用法?Java Keys.UP怎么用?Java Keys.UP使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.badlogic.gdx.Input.Keys
的用法示例。
在下文中一共展示了Keys.UP属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: keyDown
@Override
public boolean keyDown(int keycode) {
if (keycode == Keys.UP) {
upPressed = true;
} else if (keycode == Keys.LEFT) {
leftPressed = true;
} else if (keycode == Keys.DOWN) {
downPressed = true;
} else if (keycode == Keys.RIGHT) {
rightPressed = true;
}
if (keycode == Keys.E) {
ePressed = true;
} else if (keycode == Keys.W) {
wPressed = true;
}
return false;
}
示例2: keyUp
@Override
public boolean keyUp(int keycode) {
if (keycode == Keys.UP) {
upPressed = false;
} else if (keycode == Keys.LEFT) {
leftPressed = false;
} else if (keycode == Keys.DOWN) {
downPressed = false;
} else if (keycode == Keys.RIGHT) {
rightPressed = false;
}
// When releasing the action key, reset the key delay so they can be pressed again immediately
if (keycode == Keys.E) {
ePressed = false;
actionDelay = 0;
}
return false;
}
示例3: keyDown
@Override
public boolean keyDown(int keycode) {
if (keycode == Keys.UP) {
upPressed = true;
} else if (keycode == Keys.LEFT) {
leftPressed = true;
} else if (keycode == Keys.DOWN) {
downPressed = true;
} else if (keycode == Keys.RIGHT) {
rightPressed = true;
}
if (keycode == Keys.E) {
firePressed = true;
} else if (keycode == Keys.W) {
shieldPressed = true;
}
if (keycode == Keys.ENTER) {
startJustPressed = true;
}
return false;
}
示例4: keyUp
@Override
public boolean keyUp(int keycode) {
if (keycode == Keys.UP) {
upPressed = false;
} else if (keycode == Keys.LEFT) {
leftPressed = false;
} else if (keycode == Keys.DOWN) {
downPressed = false;
} else if (keycode == Keys.RIGHT) {
rightPressed = false;
}
// When releasing the action key, reset the key delay so they can be pressed again immediately
if (keycode == Keys.E) {
firePressed = false;
actionDelay = 0;
}
return false;
}
示例5: keyDown
@Override
public boolean keyDown (int keycode) {
switch (keycode) {
case Keys.DOWN:
downPressed = true;
break;
case Keys.UP:
upPressed = true;
break;
case Keys.LEFT:
leftPressed = true;
break;
case Keys.RIGHT:
rightPressed = true;
break;
}
return super.keyDown(keycode);
}
示例6: keyUp
@Override
public boolean keyUp (int keycode) {
switch (keycode) {
case Keys.DOWN:
downPressed = false;
break;
case Keys.UP:
upPressed = false;
break;
case Keys.LEFT:
leftPressed = false;
break;
case Keys.RIGHT:
rightPressed = false;
break;
case Keys.R:
chassis.body.setWorldTransform(chassis.transform.setToTranslation(0, 5, 0));
chassis.body.setInterpolationWorldTransform(chassis.transform);
((btRigidBody)(chassis.body)).setLinearVelocity(Vector3.Zero);
((btRigidBody)(chassis.body)).setAngularVelocity(Vector3.Zero);
chassis.body.activate();
break;
}
return super.keyUp(keycode);
}
示例7: keyDown
@Override
public boolean keyDown(final int keycode) {
switch (keycode) {
case Keys.UP:
TurnScheduler.getInstance().addTurnToQueue(Move.UP);
return true;
case Keys.DOWN:
TurnScheduler.getInstance().addTurnToQueue(Move.DOWN);
return true;
case Keys.LEFT:
TurnScheduler.getInstance().addTurnToQueue(Move.LEFT);
return true;
case Keys.RIGHT:
TurnScheduler.getInstance().addTurnToQueue(Move.RIGHT);
return true;
default:
return false;
}
}
示例8: KeyboardControl
public KeyboardControl() {
// Initial settings:
up = Keys.UP;
down = Keys.DOWN;
left = Keys.LEFT;
right = Keys.RIGHT;
}
示例9: onTurn
@Override
/*********************************************************
* Called on every turn
* @return true if something actually happened in a turn
* (if false, the player is NOT moved in the queue!)
*********************************************************/
public boolean onTurn(){
super.onTurn();
Core.redraw = true;
Integer log = input.checkKeys();
if (log == null) return false;
switch (log){
case Keys.LEFT:
move(-1, 0);
break;
case Keys.RIGHT:
move(1, 0);
break;
case Keys.UP:
move(0, 1);
break;
case Keys.DOWN:
move(0, -1);
break;
case Keys.E:
Core.game.setScreen(new DungeonOverviewScreen(holder.getDungeon().getWorld()));
case Keys.X:
holder.useStairs();
holder.getDungeon().getWorld().changeFloors(holder.getDungeon());
break;
default:
return false;
}
housekeep();
return true;
}
示例10: checkKeys
/********************************************
* Check keys for presses
* Automatically converts synonymous keys
* @return the highest priority active key
********************************************/
public Integer checkKeys(){
if (checkKey(Keys.UP) || checkKey(Keys.W)) return Keys.UP;
if (checkKey(Keys.DOWN) || checkKey(Keys.S)) return Keys.DOWN;
if (checkKey(Keys.LEFT) || checkKey(Keys.A)) return Keys.LEFT;
if (checkKey(Keys.RIGHT) || checkKey(Keys.D)) return Keys.RIGHT;
if (checkNewKey(Keys.X)) return Keys.X;
if (checkNewKey(Keys.E)) return Keys.E;
return null;
}
示例11: keyDown
@Override
public boolean keyDown(int keycode) {
if (InputUtil.isArrowKey(keycode)) {
keyScrollingX = Keys.LEFT == keycode ? -1 : (Keys.RIGHT == keycode ? 1 : keyScrollingX);
keyScrollingY = Keys.DOWN == keycode ? -1 : (Keys.UP == keycode ? 1 : keyScrollingY);
}
return false;
}
示例12: keyUp
@Override
public boolean keyUp(int keycode) {
if (InputUtil.isArrowKey(keycode)) {
if (Keys.LEFT == keycode || Keys.RIGHT == keycode) {
keyScrollingX = 0;
} else if (Keys.DOWN == keycode || Keys.UP == keycode) {
keyScrollingY= 0;
}
}
return false;
}
示例13: keyDown
@Override
public boolean keyDown(int keycode) {
if (!isInputBlocked && keycode == Keys.UP) {
for (Entity entity : getEntities()) {
PlayerComponent player = Mappers.player.get(entity);
player.jump = true;
}
}
return false;
}
示例14: keyUp
@Override
public boolean keyUp(int keycode) {
if (!isInputBlocked && keycode == Keys.UP) {
for (Entity entity : getEntities()) {
PlayerComponent player = Mappers.player.get(entity);
player.jump = false;
}
}
return false;
}
示例15: keyUp
public boolean keyUp(int k) {
if(mode==0){
if(k == Keys.W || k == Keys.UP) MyInput.setKey(Input.UP, false);
if(k == Keys.A || k == Keys.LEFT) MyInput.setKey(Input.LEFT, false);
if(k == Keys.S || k == Keys.DOWN) MyInput.setKey(Input.DOWN, false);
if(k == Keys.D || k == Keys.RIGHT) MyInput.setKey(Input.RIGHT, false);
if(k == Keys.SPACE) MyInput.setKey(Input.JUMP, false);
if(k == Keys.Q || k == Keys.CONTROL_RIGHT) MyInput.setKey(Input.INTERACT, false);
if(k == Keys.E || k == Keys.NUMPAD_0) MyInput.setKey(Input.ATTACK, false);
if(k == Keys.SHIFT_LEFT) MyInput.setKey(Input.SPECIAL, false);
if(k == Keys.CONTROL_LEFT || k == Keys.Z) MyInput.setKey(Input.RUN, false);
if(k == Keys.R || k == Keys.NUMPAD_1) MyInput.setKey(Input.USE, false);
if(k == Keys.ESCAPE) MyInput.setKey(Input.PAUSE, false);
if(k == Keys.ENTER) MyInput.setKey(Input.ENTER, false);
if(k == Keys.TAB) MyInput.setKey(Input.RESPAWN, false);
if(k == Keys.NUMPAD_8 || k == Keys.U) MyInput.setKey(Input.DEBUG_UP, false);
if(k == Keys.NUMPAD_2 || k == Keys.J) MyInput.setKey(Input.DEBUG_DOWN, false);
if(k == Keys.NUMPAD_4 || k == Keys.I) MyInput.setKey(Input.DEBUG_LEFT, false);
if(k == Keys.NUMPAD_6 || k == Keys.O) MyInput.setKey(Input.DEBUG_RIGHT, false);
if(k == Keys.NUMPAD_7 || k == Keys.LEFT_BRACKET) MyInput.setKey(Input.DEBUG_LEFT2, false);
if(k == Keys.NUMPAD_9 || k == Keys.RIGHT_BRACKET) MyInput.setKey(Input.DEBUG_RIGHT2, false);
if(k == Keys.M) MyInput.setKey(Input.DEBUG_CENTER, false);
if(k == Keys.F1) MyInput.setKey(Input.COLLISION, false);
if(k == Keys.F2) MyInput.setKey(Input.LIGHTS, false);
if(k == Keys.F3) MyInput.setKey(Input.DEBUG_TEXT, false);
if(k == Keys.F4) MyInput.setKey(Input.RENDER, false);
if(k == Keys.EQUALS) MyInput.setKey(Input.ZOOM_IN, false);
if(k == Keys.MINUS) MyInput.setKey(Input.ZOOM_OUT, false);
} else {
if(k == Keys.ESCAPE){ MyInput.setKey(Input.PAUSE, false); }
if(k == Keys.SPACE){ MyInput.setKey(Input.JUMP, false); }
if(k == Keys.ENTER){ MyInput.setKey(Input.ENTER, false); }
if(k == Keys.LEFT){ MyInput.setKey(Input.LEFT, false); }
if(k == Keys.RIGHT){ MyInput.setKey(Input.RIGHT, false); }
if(Keys.toString(k).toLowerCase().equals("delete")){ MyInput.setKey(Input.DOWN, false); }
if(k == Keys.SHIFT_LEFT || k == Keys.SHIFT_RIGHT){ MyInput.setKey(Input.UP, false); }
}
return true;
}