本文整理汇总了Java中br.com.etyllica.core.event.KeyEvent.isKeyDown方法的典型用法代码示例。如果您正苦于以下问题:Java KeyEvent.isKeyDown方法的具体用法?Java KeyEvent.isKeyDown怎么用?Java KeyEvent.isKeyDown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类br.com.etyllica.core.event.KeyEvent
的用法示例。
在下文中一共展示了KeyEvent.isKeyDown方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateKeyboard
import br.com.etyllica.core.event.KeyEvent; //导入方法依赖的package包/类
@Override
public GUIEvent updateKeyboard(KeyEvent event) {
if(event.isKeyDown(KeyEvent.TSK_1)) {
client.sendMessage("Hi!");
}
else if(event.isKeyDown(KeyEvent.TSK_2)) {
client.sendMessage("Help Me!");
}
else if(event.isKeyDown(KeyEvent.TSK_3)) {
client.sendMessage("Run!!");
}
//Ignore Repeat Keys
if(event.getState() != KeyState.TYPED)
client.sendKeyAction(new KeyAction(event.getKey(), event.getState()));
return GUIEvent.NONE;
}
示例2: updateKeyboard
import br.com.etyllica.core.event.KeyEvent; //导入方法依赖的package包/类
@Override
public GUIEvent updateKeyboard(KeyEvent event) {
controller1.updateKeyboard(event);
controller2.updateKeyboard(event);
if (event.isKeyDown(KeyEvent.TSK_I)) {
droneCamera1.offsetX(+1);
}
if (event.isKeyDown(KeyEvent.TSK_K)) {
droneCamera1.offsetX(-1);
}
if (event.isKeyDown(KeyEvent.TSK_L)) {
droneCamera1.offsetZ(+1);
}
if (event.isKeyDown(KeyEvent.TSK_J)) {
droneCamera1.offsetZ(-1);
}
return GUIEvent.NONE;
}
示例3: updateKeyboard
import br.com.etyllica.core.event.KeyEvent; //导入方法依赖的package包/类
@Override
public GUIEvent updateKeyboard(KeyEvent event) {
controller.updateKeyboard(event);
if (event.isKeyDown(KeyEvent.TSK_I)) {
droneCamera.offsetX(+1);
}
if (event.isKeyDown(KeyEvent.TSK_K)) {
droneCamera.offsetX(-1);
}
if (event.isKeyDown(KeyEvent.TSK_L)) {
droneCamera.offsetZ(+1);
}
if (event.isKeyDown(KeyEvent.TSK_J)) {
droneCamera.offsetZ(-1);
}
return GUIEvent.NONE;
}
示例4: updateKeyboard
import br.com.etyllica.core.event.KeyEvent; //导入方法依赖的package包/类
@Override
public GUIEvent updateKeyboard(KeyEvent event) {
controller1.updateKeyboard(event);
if (event.isKeyDown(KeyEvent.TSK_I)) {
droneCamera1.offsetX(+1);
}
if (event.isKeyDown(KeyEvent.TSK_K)) {
droneCamera1.offsetX(-1);
}
if (event.isKeyDown(KeyEvent.TSK_L)) {
droneCamera1.offsetZ(+1);
}
if (event.isKeyDown(KeyEvent.TSK_J)) {
droneCamera1.offsetZ(-1);
}
return GUIEvent.NONE;
}
示例5: 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;
}
示例6: updateKeyboard
import br.com.etyllica.core.event.KeyEvent; //导入方法依赖的package包/类
@Override
public GUIEvent updateKeyboard(KeyEvent event) {
if (event.isKeyDown(KeyEvent.TSK_I)) {
// droneCamera.getTarget().setOffsetX(+1);
droneCamera.offsetX(+1);
}
if (event.isKeyDown(KeyEvent.TSK_K)) {
// droneCamera.getTarget().setOffsetX(-1);
droneCamera.offsetX(-1);
}
if (event.isKeyDown(KeyEvent.TSK_L)) {
// droneCamera.getTarget().setOffsetZ(+1);
droneCamera.offsetZ(+1);
}
if (event.isKeyDown(KeyEvent.TSK_J)) {
// droneCamera.getTarget().setOffsetZ(-1);
droneCamera.offsetZ(-1);
}
return GUIEvent.NONE;
}
示例7: updateKeyboard
import br.com.etyllica.core.event.KeyEvent; //导入方法依赖的package包/类
@Override
public GUIEvent updateKeyboard(KeyEvent event) {
controller.updateKeyboard(event);
if (event.isKeyDown(KeyEvent.TSK_1)) {
currentCamera = cameraGL;
} else if (event.isKeyDown(KeyEvent.TSK_2)) {
currentCamera = personView;
}
if (event.isKeyDown(KeyEvent.TSK_I)) {
// droneCamera.getTarget().offsetX(+1);
droneCamera.offsetX(+1);
}
if (event.isKeyDown(KeyEvent.TSK_K)) {
// droneCamera.getTarget().offsetX(-1);
droneCamera.offsetX(-1);
}
if (event.isKeyDown(KeyEvent.TSK_L)) {
// droneCamera.getTarget().offsetZ(+1);
droneCamera.offsetZ(+1);
}
if (event.isKeyDown(KeyEvent.TSK_J)) {
// droneCamera.getTarget().offsetZ(-1);
droneCamera.offsetZ(-1);
}
if (event.isKeyDown(KeyEvent.TSK_Z)) {
drone.offsetX(-10);
//terrain.offsetX(-20);
}
if (event.isKeyDown(KeyEvent.TSK_X)) {
drone.offsetX(10);
//terrain.offsetX(-20);
}
if (event.isKeyDown(KeyEvent.TSK_C)) {
//terrain.offsetX(+20);
}
return GUIEvent.NONE;
}
示例8: 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;
}
示例9: 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;
}
示例10: 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;
}
示例11: updateKeyboard
import br.com.etyllica.core.event.KeyEvent; //导入方法依赖的package包/类
@Override
public GUIEvent updateKeyboard(KeyEvent event) {
controller.updateKeyboard(event);
if (event.isKeyDown(KeyEvent.TSK_I)) {
// droneCamera.getTarget().setOffsetX(+1);
droneCamera.offsetX(+1);
}
if (event.isKeyDown(KeyEvent.TSK_K)) {
// droneCamera.getTarget().setOffsetX(-1);
droneCamera.offsetX(-1);
}
if (event.isKeyDown(KeyEvent.TSK_L)) {
// droneCamera.getTarget().setOffsetZ(+1);
droneCamera.offsetZ(+1);
}
if (event.isKeyDown(KeyEvent.TSK_J)) {
// droneCamera.getTarget().setOffsetZ(-1);
droneCamera.offsetZ(-1);
}
return GUIEvent.NONE;
}