comp.isAnalog(), comp.isRelative(), comp.getDeadZone() ); addAxis(axis); this, getAxisCount(), JoystickAxis.POV_X, id.getName() + "_x", comp.isAnalog(), comp.isRelative(), comp.getDeadZone() ); logger.log(Level.FINE, "Adding axis: \"{0}\" id:" + id.getName() + "_x", povX.getName() ); addAxis(povX); this, getAxisCount(), JoystickAxis.POV_Y, id.getName() + "_y", comp.isAnalog(), comp.isRelative(), comp.getDeadZone() ); logger.log(Level.FINE, "Adding axis: \"{0}\" id:" + id.getName() + "_y", povY.getName() ); addAxis(povY);
public BooleanYoVariableJoystickEventListener(YoBoolean variable, Component component, boolean toggle, boolean flip) { if (component.isAnalog()) throw new RuntimeException("component is analog; should be digital (i.e. an on/off button)"); this.variable = variable; this.component = component; this.flip = flip; this.toggle=toggle; }
bool xReleased = false, yReleased = false; Component[] components = controller.getComponents(); for(Component component : components) { if(component.isAnalog()) { //test that controller is analog Identifier id = component.getIdentifier(); float axisPosition = component.getPollData(); //range: -1 to 1 if(id == Component.Identifier.Axis.X && axisPosition == 0) xReleased = true; if(id == Component.Identifier.Axis.Y && axisPosition == 0) yReleased = true; } } if(xReleased && yReleased) { //do something... }
private void addAxis(JPanel p, Component ax){ JPanel p2; if (ax.isAnalog()) { p2 = new AnalogAxisPanel(ax); } else { if (ax.getIdentifier() == Component.Identifier.Axis.POV) { p2 = new DigitalHatPanel(ax); } else { p2 = new DigitalAxisPanel(ax); } } p.add(p2); axes_to_panels.put(ax, p2); }
private void addAxis(JPanel p, Component ax){ JPanel p2; if (ax.isAnalog()) { p2 = new AnalogAxisPanel(ax); } else { if (ax.getIdentifier() == Component.Identifier.Axis.POV) { p2 = new DigitalHatPanel(ax); } else { p2 = new DigitalAxisPanel(ax); } } p.add(p2); axisList.add(p2); //ax.setPolling(true); }
System.out.print("Absolute"); if (components[j].isAnalog()) { System.out.print(" Analog"); } else {
if (components[i].isAnalog()) {
if (comp.isAnalog()) { buffer.append(value); } else {
comp.isAnalog(), comp.isRelative(), comp.getDeadZone() ); addAxis(axis); this, getAxisCount(), JoystickAxis.POV_X, id.getName() + "_x", comp.isAnalog(), comp.isRelative(), comp.getDeadZone() ); logger.log(Level.FINE, "Adding axis: \"{0}\" id:" + id.getName() + "_x", povX.getName() ); addAxis(povX); this, getAxisCount(), JoystickAxis.POV_Y, id.getName() + "_y", comp.isAnalog(), comp.isRelative(), comp.getDeadZone() ); logger.log(Level.FINE, "Adding axis: \"{0}\" id:" + id.getName() + "_y", povY.getName() ); addAxis(povY);