本文整理汇总了Java中br.com.etyllica.core.event.KeyEvent.isKeyUp方法的典型用法代码示例。如果您正苦于以下问题:Java KeyEvent.isKeyUp方法的具体用法?Java KeyEvent.isKeyUp怎么用?Java KeyEvent.isKeyUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类br.com.etyllica.core.event.KeyEvent
的用法示例。
在下文中一共展示了KeyEvent.isKeyUp方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateKeyboard
import br.com.etyllica.core.event.KeyEvent; //导入方法依赖的package包/类
@Override
public GUIEvent updateKeyboard(KeyEvent event) {
if(event.isKeyDown(KeyEvent.TSK_UP_ARROW)){
paddleUP = true;
paddleDOWN = false;
}else if(event.isKeyUp(KeyEvent.TSK_UP_ARROW)){
paddleUP = false;
}
if(event.isKeyDown(KeyEvent.TSK_DOWN_ARROW)){
paddleDOWN = true;
paddleUP = false;
}
else if(event.isKeyUp(KeyEvent.TSK_DOWN_ARROW)){
paddleDOWN = false;
}
return null;
}
示例2: updateKeyboard
import br.com.etyllica.core.event.KeyEvent; //导入方法依赖的package包/类
public GUIEvent updateKeyboard(KeyEvent event) {
if(event.isAnyKeyDown(KeyEvent.TSK_SHIFT_RIGHT, KeyEvent.TSK_SHIFT_LEFT)) {
shiftPressed = true;
} else if(event.isAnyKeyUp(KeyEvent.TSK_SHIFT_RIGHT, KeyEvent.TSK_SHIFT_LEFT)) {
shiftPressed = false;
}
if(event.isKeyDown(KeyEvent.TSK_UP_ARROW)) {
//if(shiftPressed) {
moveUp = true;
//} else {
//moveForward = true;
//}
} else if(event.isKeyUp(KeyEvent.TSK_UP_ARROW)) {
moveUp = false;
moveForward = false;
}
if(event.isKeyDown(KeyEvent.TSK_UP_ARROW)) {
moveUp = true;
} else if(event.isKeyUp(KeyEvent.TSK_UP_ARROW)) {
moveUp = false;
}
if(event.isKeyDown(KeyEvent.TSK_DOWN_ARROW)) {
moveDown = true;
} else if(event.isKeyUp(KeyEvent.TSK_DOWN_ARROW)) {
moveDown = false;
}
if(event.isKeyDown(KeyEvent.TSK_LEFT_ARROW)) {
turnLeft = true;
} else if(event.isKeyUp(KeyEvent.TSK_LEFT_ARROW)) {
turnLeft = false;
}
if(event.isKeyDown(KeyEvent.TSK_RIGHT_ARROW)) {
turnRight = true;
} else if(event.isKeyUp(KeyEvent.TSK_RIGHT_ARROW)) {
turnRight = false;
}
if(event.isKeyDown(KeyEvent.TSK_D)) {
moveRight = true;
} else if(event.isKeyUp(KeyEvent.TSK_D)) {
moveRight = false;
}
if(event.isKeyDown(KeyEvent.TSK_A)) {
moveLeft = true;
} else if(event.isKeyUp(KeyEvent.TSK_A)) {
moveLeft = false;
}
if(event.isKeyDown(KeyEvent.TSK_S)) {
turnDown = true;
} else if(event.isKeyUp(KeyEvent.TSK_S)) {
turnDown = false;
}
if(event.isKeyDown(KeyEvent.TSK_W)) {
turnUp = true;
//moveForward = true;
} else if(event.isKeyUp(KeyEvent.TSK_W)) {
turnUp = false;
//moveForward = false;
}
return null;
}
示例3: updateKeyboard
import br.com.etyllica.core.event.KeyEvent; //导入方法依赖的package包/类
public GUIEvent updateKeyboard(KeyEvent event) {
if(event.isAnyKeyDown(KeyEvent.TSK_SHIFT_RIGHT, KeyEvent.TSK_SHIFT_LEFT)) {
shiftPressed = true;
} else if(event.isAnyKeyUp(KeyEvent.TSK_SHIFT_RIGHT, KeyEvent.TSK_SHIFT_LEFT)) {
shiftPressed = false;
}
if(event.isKeyDown(KeyEvent.TSK_UP_ARROW)) {
//if(shiftPressed) {
moveUp = true;
//} else {
//moveForward = true;
//}
} else if(event.isKeyUp(KeyEvent.TSK_UP_ARROW)) {
moveUp = false;
moveForward = false;
}
if(event.isKeyDown(KeyEvent.TSK_UP_ARROW)) {
moveUp = true;
} else if(event.isKeyUp(KeyEvent.TSK_UP_ARROW)) {
moveUp = false;
}
if(event.isKeyDown(KeyEvent.TSK_DOWN_ARROW)) {
moveDown = true;
} else if(event.isKeyUp(KeyEvent.TSK_DOWN_ARROW)) {
moveDown = false;
}
if(event.isKeyDown(KeyEvent.TSK_LEFT_ARROW)) {
turnLeft = true;
} else if(event.isKeyUp(KeyEvent.TSK_LEFT_ARROW)) {
turnLeft = false;
}
if(event.isKeyDown(KeyEvent.TSK_RIGHT_ARROW)) {
turnRight = true;
} else if(event.isKeyUp(KeyEvent.TSK_RIGHT_ARROW)) {
turnRight = false;
}
if(event.isKeyDown(KeyEvent.TSK_D)) {
moveRight = true;
} else if(event.isKeyUp(KeyEvent.TSK_D)) {
moveRight = false;
}
if(event.isKeyDown(KeyEvent.TSK_A)) {
moveLeft = true;
} else if(event.isKeyUp(KeyEvent.TSK_A)) {
moveLeft = false;
}
if(event.isKeyDown(KeyEvent.TSK_S)) {
turnDown = true;
} else if(event.isKeyUp(KeyEvent.TSK_S)) {
turnDown = false;
}
if(event.isKeyDown(KeyEvent.TSK_W)) {
turnUp = true;
//moveForward = true;
} else if(event.isKeyUp(KeyEvent.TSK_W)) {
turnUp = false;
//moveForward = false;
}
return null;
}
示例4: updateKeyboard
import br.com.etyllica.core.event.KeyEvent; //导入方法依赖的package包/类
@Override
public GUIEvent updateKeyboard(KeyEvent event){
if(event.isKeyDown(KeyEvent.TSK_Q)){
box.pressUpperLeft();
markq.setVisible(true);
//beat1.play();
}else if(event.isKeyUp(KeyEvent.TSK_Q)){
box.unpressUpperLeft();
markq.setVisible(false);
}
if(event.isKeyDown(KeyEvent.TSK_A)){
box.pressLowerLeft();
marka.setVisible(true);
//beat2.play();
}else if(event.isKeyUp(KeyEvent.TSK_A)){
box.unpressLowerLeft();
marka.setVisible(false);
}
if(event.isKeyDown(KeyEvent.TSK_P)){
box.pressUpperRight();
markp.setVisible(true);
//beat1.play();
}else if(event.isKeyUp(KeyEvent.TSK_P)){
box.unpressUpperRight();
markp.setVisible(false);
}
if(event.isKeyDown(KeyEvent.TSK_L)){
box.pressLowerRight();
markl.setVisible(true);
//beat2.play();
}else if(event.isKeyUp(KeyEvent.TSK_L)){
box.unpressLowerRight();
markl.setVisible(false);
}
return GUIEvent.NONE;
}