本文整理汇总了Java中br.com.etyllica.core.event.KeyEvent类的典型用法代码示例。如果您正苦于以下问题:Java KeyEvent类的具体用法?Java KeyEvent怎么用?Java KeyEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KeyEvent类属于br.com.etyllica.core.event包,在下文中一共展示了KeyEvent类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:yuripourre,项目名称:multiplayer,代码行数:22,代码来源:ClientApplication.java
示例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;
}
开发者ID:yuripourre,项目名称:drone4,代码行数:25,代码来源:MultiPilotEnvironment.java
示例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;
}
开发者ID:yuripourre,项目名称:drone4,代码行数:24,代码来源:CleanEnvironment.java
示例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;
}
开发者ID:yuripourre,项目名称:drone4,代码行数:24,代码来源:WindEnvironment.java
示例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;
}
开发者ID:yuripourre,项目名称:etyllic-pong,代码行数:21,代码来源:PongApplication.java
示例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;
}
开发者ID:yuripourre,项目名称:drone4,代码行数:30,代码来源:RemoteEnvironment.java
示例7: setupControllers
import br.com.etyllica.core.event.KeyEvent; //导入依赖的package包/类
private void setupControllers() {
controller2.upKey = KeyEvent.TSK_NUMPAD_8;
controller2.turnLeftKey = KeyEvent.TSK_NUMPAD_4;
controller2.downKey = KeyEvent.TSK_NUMPAD_5;
controller2.turnRightKey = KeyEvent.TSK_NUMPAD_6;
controller2.forwardKey = KeyEvent.TSK_UP_ARROW;
controller2.leftKey = KeyEvent.TSK_LEFT_ARROW;
controller2.backwardKey = KeyEvent.TSK_DOWN_ARROW;
controller2.rightKey = KeyEvent.TSK_RIGHT_ARROW;
}
开发者ID:yuripourre,项目名称:drone4,代码行数:11,代码来源:MultiPilotEnvironment.java
示例8: 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;
}
开发者ID:yuripourre,项目名称:drone4,代码行数:52,代码来源:BeachEnvironment.java
示例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;
}
开发者ID:yuripourre,项目名称:drone4,代码行数:73,代码来源:DEMView.java
示例10: 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;
}
开发者ID:yuripourre,项目名称:drone4,代码行数:73,代码来源:TriangulatorView.java
示例11: updateKeyboard
import br.com.etyllica.core.event.KeyEvent; //导入依赖的package包/类
@Override
public GUIEvent updateKeyboard(KeyEvent event) {
return GUIEvent.NONE;
}
开发者ID:yuripourre,项目名称:drone4,代码行数:6,代码来源:IndoorEnvironment.java
示例12: 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;
}
开发者ID:yuripourre,项目名称:htbm-v2,代码行数:52,代码来源:HeartGame.java
示例13: updateKeyboard
import br.com.etyllica.core.event.KeyEvent; //导入依赖的package包/类
@Override
public GUIEvent updateKeyboard(KeyEvent event) {
// TODO Auto-generated method stub
return GUIEvent.NONE;
}
开发者ID:yuripourre,项目名称:htbm-v2,代码行数:6,代码来源:Credits.java
示例14: updateKeyboard
import br.com.etyllica.core.event.KeyEvent; //导入依赖的package包/类
@Override
public GUIEvent updateKeyboard(KeyEvent event) {
return null;
}
开发者ID:yuripourre,项目名称:etyllic-pong,代码行数:6,代码来源:MainMenu.java
示例15: 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;
}
开发者ID:yuripourre,项目名称:drone4,代码行数:32,代码来源:SportsEnvironment.java
示例16: updateKeyboard
import br.com.etyllica.core.event.KeyEvent; //导入依赖的package包/类
@Override
public GUIEvent updateKeyboard(KeyEvent event) {
easyController.handleEvent(event);
firstPlayerController.handleEvent(event);
return null;
}
开发者ID:yuripourre,项目名称:marvel-quest,代码行数:10,代码来源:FirstStage.java
注:本文中的br.com.etyllica.core.event.KeyEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论