processing.event.KeyEvent.getAction()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中processing.event.KeyEvent.getAction()方法的一些代码示例,展示了KeyEvent.getAction()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KeyEvent.getAction()方法的具体详情如下:
包路径:processing.event.KeyEvent
类名称:KeyEvent
方法名:getAction

KeyEvent.getAction介绍

暂无

代码示例

代码示例来源: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: poqudrof/PapARt

if (e.getAction() == KeyEvent.PRESS) {

代码示例来源: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: 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: org.processing/core

keyCode = event.getKeyCode();
switch (event.getAction()) {
case KeyEvent.PRESS:
 Long hash = ((long) keyCode << Character.SIZE) | key;
if (event.getAction() == KeyEvent.PRESS) {

相关文章