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

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

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

KeyEvent.getKeyCode介绍

暂无

代码示例

代码示例来源: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();
   event.getKeyCode() == 'W' &&
   ((event.isMetaDown() && platform == MACOSX) ||
    (event.isControlDown() && platform != MACOSX))) {

相关文章