com.harium.etyl.commons.event.KeyEvent.isKeyUp()方法的使用及代码示例

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

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

KeyEvent.isKeyUp介绍

暂无

代码示例

代码示例来源:origin: com.harium.etyl/commons

public boolean isAnyKeyUp(int... keyCodes) {
  if (consumed) {
    return false;
  }
  for (int keyCode : keyCodes) {
    if (isKeyUp(keyCode)) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: com.harium/etyl

private GUIEvent updateReleased(KeyEvent event) {
  if (control) {
    if (event.isKeyDown(KeyEvent.VK_CTRL_RIGHT)||event.isKeyDown(KeyEvent.VK_CTRL_LEFT)) {
      control = false;
    }
  }
  if (shift) {
    if (event.isKeyUp(KeyEvent.VK_SHIFT_RIGHT)||event.isKeyUp(KeyEvent.VK_SHIFT_LEFT)) {
      shift = false;
      minMark = cursor;
      maxMark = cursor;
    }
  }
  return GUIEvent.NONE;
}

代码示例来源:origin: com.harium.etyl/etyl

@Override
public void updateKeyboard(KeyEvent event) {
  super.updateKeyboard(event);
  if (checkSequence(event)) {
    System.exit(0);
  }
  if (event.isKeyUp(KeyEvent.VK_E)) {
    System.exit(0);
  }
}

代码示例来源:origin: com.harium.propan/propan

public void updateKeyboard(KeyEvent event) {
  if (event.isKeyDown(KeyEvent.VK_UP_ARROW)) {
    forwardPressed = true;
  } else if (event.isKeyUp(KeyEvent.VK_UP_ARROW)) {
    forwardPressed = false;
  } else if (event.isKeyUp(KeyEvent.VK_DOWN_ARROW)) {
    backwardPressed = false;
  } else if (event.isKeyUp(KeyEvent.VK_NUMPAD8)) {
    upPressed = false;
  } else if (event.isKeyUp(KeyEvent.VK_NUMPAD2)) {
    downPressed = false;
  } else if (event.isKeyUp(KeyEvent.VK_NUMPAD6)) {
    rightPressed = false;
  } else if (event.isKeyUp(KeyEvent.VK_NUMPAD4)) {
    leftPressed = false;
  } else if (event.isKeyUp(KeyEvent.VK_SPACE)) {
    liftPressed = false;

代码示例来源:origin: com.harium.propan/propan-gdx

public void updateKeyboard(KeyEvent event) {
  if (event.isKeyDown(KeyEvent.VK_W)) {
    forward = true;
  } else if (event.isKeyUp(KeyEvent.VK_W)) {
    forward = false;
  } else if (event.isKeyUp(KeyEvent.VK_S)) {
    backward = false;
  } else if (event.isKeyUp(KeyEvent.VK_A)) {
    left = false;
  } else if (event.isKeyUp(KeyEvent.VK_D)) {
    right = false;
  } else if (event.isKeyUp(KeyEvent.VK_UP)) {
    up = false;
  } else if (event.isKeyUp(KeyEvent.VK_DOWN)) {
    down = false;
  } else if (event.isKeyUp(KeyEvent.VK_RIGHT)) {
    turnRight = false;
  } else if (event.isKeyUp(KeyEvent.VK_LEFT)) {
    turnLeft = false;

代码示例来源:origin: com.harium.propan/propan

if (event.isKeyDown(KeyEvent.VK_W)) {
  forwardPressed = true;
} else if (event.isKeyUp(KeyEvent.VK_W)) {
  forwardPressed = false;
} else if (event.isKeyUp(KeyEvent.VK_S)) {
  backwardPressed = false;
} else if (event.isKeyUp(KeyEvent.VK_E)) {
  liftPressed = false;
} else if (event.isKeyUp(KeyEvent.VK_Q)) {
  divePressed = false;
} else if (event.isKeyUp(KeyEvent.VK_D)) {
  strafeRightPressed = false;
} else if (event.isKeyUp(KeyEvent.VK_A)) {
  strafeLeftPressed = false;
} else if (event.isKeyUp(KeyEvent.VK_UP_ARROW)) {
  upPressed = false;
} else if (event.isKeyUp(KeyEvent.VK_DOWN_ARROW)) {
  downPressed = false;
} else if (event.isKeyUp(KeyEvent.VK_RIGHT_ARROW)) {
  rightPressed = false;

代码示例来源:origin: com.harium.propan/propan

public void updateKeyboard(KeyEvent event) {
  if (event.isKeyDown(KeyEvent.VK_W)) {
    forwardPressed = true;
  } else if (event.isKeyUp(KeyEvent.VK_W)) {
    forwardPressed = false;
  } else if (event.isKeyUp(KeyEvent.VK_S)) {
    backwardPressed = false;
  } else if (event.isKeyUp(KeyEvent.VK_A)) {
    strafeLeftPressed = false;
  } else if (event.isKeyUp(KeyEvent.VK_D)) {
    strafeRightPressed = false;
  } else if (event.isKeyUp(KeyEvent.VK_UP_ARROW)) {
    upPressed = false;
  } else if (event.isKeyUp(KeyEvent.VK_DOWN_ARROW)) {
    downPressed = false;
  } else if (event.isKeyUp(KeyEvent.VK_RIGHT_ARROW)) {
    rightPressed = false;
  } else if (event.isKeyUp(KeyEvent.VK_LEFT_ARROW)) {
    leftPressed = false;
  } else if (event.isKeyUp(KeyEvent.VK_SPACE)) {
    liftPressed = false;

代码示例来源:origin: com.harium/etyl

private void updateKeyboardEvents(KeyEvent event) {
  if (event.isKeyDown(KeyEvent.VK_ALT_RIGHT) || event.isKeyDown(KeyEvent.VK_ALT_LEFT)) {
    alt = true;
  } else if (event.isKeyUp(KeyEvent.VK_ALT_RIGHT) || event.isKeyUp(KeyEvent.VK_ALT_LEFT)) {
    alt = false;
  }
  if (event.isKeyDown(KeyEvent.VK_ENTER)) {
    enter = true;
  } else if (event.isKeyUp(KeyEvent.VK_ENTER)) {
    enter = false;
  }
  if (event.isKeyDown(KeyEvent.VK_ESC)) {
    esc = true;
  } else if (event.isKeyUp(KeyEvent.VK_ESC)) {
    esc = false;
  }
  if (alt && enter) {
    alt = false;
    enter = false;
    if (!isFullScreenEnable()) {
      enableFullScreen = true;
    }
  }
  if (esc) {
    esc = false;
    if (isFullScreenEnable()) {
      disableFullScreen = true;
    }
  }
}

代码示例来源:origin: com.harium.etyl/etyl

private void updateKeyboardEvents(KeyEvent event) {
  if (event.isKeyDown(KeyEvent.VK_ALT_RIGHT) || event.isKeyDown(KeyEvent.VK_ALT_LEFT)) {
    alt = true;
  } else if (event.isKeyUp(KeyEvent.VK_ALT_RIGHT) || event.isKeyUp(KeyEvent.VK_ALT_LEFT)) {
    alt = false;
  }
  if (event.isKeyDown(KeyEvent.VK_ENTER)) {
    enter = true;
  } else if (event.isKeyUp(KeyEvent.VK_ENTER)) {
    enter = false;
  }
  if (event.isKeyDown(KeyEvent.VK_ESC)) {
    esc = true;
  } else if (event.isKeyUp(KeyEvent.VK_ESC)) {
    esc = false;
  }
  if (alt && enter) {
    alt = false;
    enter = false;
    if (allowFullscreen && !isFullScreenEnable()) {
      enableFullScreen = true;
    }
  }
  if (esc) {
    esc = false;
    if (isFullScreenEnable()) {
      disableFullScreen = true;
    }
  }
}

代码示例来源:origin: com.harium.etyl/etyl

} else if (event.isKeyUp(KeyEvent.VK_NUMPAD_INS)) {
  getMouse().addEvent(new PointerEvent(MouseEvent.MOUSE_BUTTON_LEFT, PointerState.RELEASED));
} else if (event.isKeyUp(KeyEvent.VK_NUMPAD_DEL)) {
  getMouse().addEvent(new PointerEvent(MouseEvent.MOUSE_BUTTON_RIGHT, PointerState.RELEASED));

代码示例来源:origin: com.harium/etyl

} else if (event.isKeyUp(KeyEvent.VK_NUMPAD_INS)) {
  getMouse().addEvent(new PointerEvent(MouseEvent.MOUSE_BUTTON_LEFT, PointerState.RELEASED));
} else if (event.isKeyUp(KeyEvent.VK_NUMPAD_DEL)) {
  getMouse().addEvent(new PointerEvent(MouseEvent.MOUSE_BUTTON_RIGHT, PointerState.RELEASED));

相关文章