本文整理了Java中processing.event.KeyEvent.getKey()
方法的一些代码示例,展示了KeyEvent.getKey()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KeyEvent.getKey()
方法的具体详情如下:
包路径:processing.event.KeyEvent
类名称:KeyEvent
方法名:getKey
暂无
代码示例来源:origin: ajavamind/Processing-Cardboard
protected void handleKeyEvent(KeyEvent event) {
// keyEvent = event;
key = event.getKey();
keyCode = event.getKeyCode();
switch (event.getAction()) {
case KeyEvent.PRESS:
keyPressed = true;
keyPressed(event);
break;
case KeyEvent.RELEASE:
keyPressed = false;
keyReleased(event);
break;
}
handleMethods("keyEvent", new Object[]{event});
}
代码示例来源:origin: poqudrof/PapARt
&& (e.getKey() == saveKey.charAt(0))) {
System.out.println("Saved to : " + filename);
this.saveLocationTo(filename);
&& (e.getKey() == trackKey.charAt(0))) {
this.useManualLocation(!this.useManualLocation, null);
String status = useManualLocation ? "ON" : "OFF";
&& (e.getKey() == loadKey.charAt(0))) {
this.loadLocationFrom(filename);
System.out.println("Loaded from: " + filename);
代码示例来源:origin: evolvio/evolv.io
public void handleKeyEvent(KeyEvent keyEvent) {
int keyActionConstant = keyEvent.getAction();
KeyAction keyAction = KeyAction.getFromConstant(keyActionConstant);
char key = keyEvent.getKey();
if (key == PConstants.CODED) {
int keyCodeConstant = keyEvent.getKeyCode();
KeyCode keyCode = KeyCode.getFromConstant(keyCodeConstant);
performAction(keyAction, keyCode, keyCodeActions, keyEvent);
} else {
performAction(keyAction, key, keyActions, keyEvent);
}
}
代码示例来源:origin: ruby-processing/JRubyArt
/**
* key event to register
*
* @param e KeyEvent
*/
public void keyEvent(processing.event.KeyEvent e) {
if (e.getAction() != KeyEvent.PRESS) {
} else {
switch (e.getKey()) {
case 'x':
constrain(Constrain.XAXIS);
break;
case 'y':
constrain(Constrain.YAXIS);
break;
case 'z':
constrain(Constrain.ZAXIS);
break;
}
}
if (e.getAction() == KeyEvent.RELEASE) {
constrain(Constrain.FREE);
}
}
代码示例来源:origin: org.processing/core
key = event.getKey();
keyCode = event.getKeyCode();
内容来源于网络,如有侵权,请联系作者删除!