net.java.games.input.Event.getComponent()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(111)

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

Event.getComponent介绍

暂无

代码示例

代码示例来源:origin: MovingBlocks/Terasology

private ControllerAction convertEvent(Controller c, Event event) {
  Component comp = event.getComponent();
  Identifier id = comp.getIdentifier();
  float axisValue = comp.getPollData();

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

Identifier id = e.getComponent().getIdentifier();
if (id == Identifier.Axis.POV){
  float x = 0, y = 0;
  float value = e.getValue();
  JoystickAxis axis = stick.axisIndex.get(e.getComponent());
  JoyAxisEvent evt = new JoyAxisEvent(axis, value);
  listener.onJoyAxisEvent(evt);
}else if (id instanceof Button){
  JoystickButton button = stick.buttonIndex.get(e.getComponent());                    
  JoyButtonEvent evt = new JoyButtonEvent(button, e.getValue() == 1f);
  listener.onJoyButtonEvent(evt);

代码示例来源:origin: us.ihmc/IHMCJavaToolkit

public static LogitechExtreme3DMapping getMapping(Event event)
  {
   return getMapping(event.getComponent());
  }
}

代码示例来源:origin: us.ihmc/IHMCJavaToolkit

public static MadCatzV1StickMapping getMapping(Event event)
  {
   return getMapping(event.getComponent());
  }
}

代码示例来源:origin: us.ihmc/ihmc-java-toolkit

public static MadCatzFLY5StickMapping getMapping(Event event)
  {
   return getMapping(event.getComponent());
  }
}

代码示例来源:origin: us.ihmc/IHMCJavaToolkit

public static Thrustmaster16000M getMapping(Event event)
  {
   return getMapping(event.getComponent());
  }
}

代码示例来源:origin: us.ihmc/IHMCJavaToolkit

public static XBoxOneMapping getMapping(Event event)
  {
   return getMapping(event.getComponent());
  }
}

代码示例来源:origin: us.ihmc/ihmc-java-toolkit

public static LogitechExtreme3DMapping getMapping(Event event)
  {
   return getMapping(event.getComponent());
  }
}

代码示例来源:origin: us.ihmc/IHMCJavaToolkit

public static SaitekX52Mapping getMapping(Event event)
  {
   return getMapping(event.getComponent());
  }
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

@Override
  public void processEvent(Event event)
  {
   if (event.getComponent() == component)
   {
     yoEnum.set(enumToSwitchTo);
   }
  }
}

代码示例来源:origin: us.ihmc/IHMCJavaToolkit

public static MadCatzFLY5StickMapping getMapping(Event event)
  {
   return getMapping(event.getComponent());
  }
}

代码示例来源:origin: us.ihmc/ihmc-java-toolkit

public static MadCatzV1StickMapping getMapping(Event event)
  {
   return getMapping(event.getComponent());
  }
}

代码示例来源:origin: us.ihmc/ihmc-java-toolkit

public static Thrustmaster16000M getMapping(Event event)
  {
   return getMapping(event.getComponent());
  }
}

代码示例来源:origin: us.ihmc/ihmc-java-toolkit

public static XBoxOneMapping getMapping(Event event)
  {
   return getMapping(event.getComponent());
  }
}

代码示例来源:origin: us.ihmc/ihmc-java-toolkit

public static SaitekX52Mapping getMapping(Event event)
  {
   return getMapping(event.getComponent());
  }
}

代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces

private ButtonState toState(Event event)
{
 if (event.getComponent().getPollData() > 0.5f)
   return ButtonState.PRESSED;
 else
   return ButtonState.RELEASED;
}

代码示例来源:origin: gurkenlabs/litiengine

private void handlePollEvents(Event event) {
 for (final BiConsumer<String, Float> cons : this.pollConsumer) {
  cons.accept(event.getComponent().getIdentifier().getName(), event.getValue());
 }
 final List<Consumer<Float>> consumers = this.componentPollConsumer.get(event.getComponent().getIdentifier().getName());
 if (consumers != null) {
  for (final Consumer<Float> cons : consumers) {
   cons.accept(event.getValue());
  }
 }
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

@Override
public void processEvent(Event event)
{
 if (event.getComponent() == component)
 {
   double value = getDPadValue(event);
   double newValue = (sign * value * increment) + variable.getDoubleValue();
      newValue = MathTools.clamp(newValue, min, max);
   variable.set(newValue);
 }
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

@Override
public void processEvent(Event event)
{
 if (event.getComponent() == component)
 {
   double valueSignChanged = sign * event.getValue();
   double valueDeadZoneCompensated = handleDeadZone(valueSignChanged, deadZone);
   double valueScaled = scaleAxisValue(min, max, valueDeadZoneCompensated);
   variable.set(valueScaled);
 }
}

代码示例来源:origin: jpcsp/jpcsp

private void pollController() {
  if (inputController != null && inputController.poll()) {
    EventQueue eventQueue = inputController.getEventQueue();
    Event event = new Event();
    while (eventQueue.getNextEvent(event)) {
      Component component = event.getComponent();
      float value = event.getValue();
      processControllerEvent(component, value);
    }
  }
}

相关文章