コード例 #1
0
    public boolean inputActionPerformed(
        AbstractViewInputHandler inputHandler,
        KeyEventState keys,
        String target,
        ViewInputAttributes.ActionAttributes viewAction) {
      java.util.List keyList = viewAction.getKeyActions();
      double rollInput = 0;

      for (Object k : keyList) {
        ViewInputAttributes.ActionAttributes.KeyAction keyAction =
            (ViewInputAttributes.ActionAttributes.KeyAction) k;
        if (keys.isKeyDown(keyAction.keyCode)) {
          rollInput += keyAction.sign;
        }
      }

      if (rollInput == 0) {
        return false;
      }

      //noinspection StringEquality
      if (target == GENERATE_EVENTS) {
        ViewInputAttributes.DeviceAttributes deviceAttributes =
            inputHandler.getAttributes().getDeviceAttributes(ViewInputAttributes.DEVICE_KEYBOARD);

        onRoll(rollInput, deviceAttributes, viewAction);
      }
      return true;
    }
コード例 #2
0
 public boolean inputActionPerformed(
     AbstractViewInputHandler inputHandler,
     java.awt.event.KeyEvent event,
     ViewInputAttributes.ActionAttributes viewAction) {
   java.util.List keyList = viewAction.getKeyActions();
   for (Object k : keyList) {
     ViewInputAttributes.ActionAttributes.KeyAction keyAction =
         (ViewInputAttributes.ActionAttributes.KeyAction) k;
     if (event.getKeyCode() == keyAction.keyCode) {
       onResetPitch(viewAction);
       return true;
     }
   }
   return false;
 }