Codota Logo
JoystickButton.getLogicalId
Code IndexAdd Codota to your IDE (free)

How to use
getLogicalId
method
in
com.jme3.input.JoystickButton

Best Java code snippets using com.jme3.input.JoystickButton.getLogicalId (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: jMonkeyEngine/jmonkeyengine

@Override
public JoystickButton getButton(String logicalId) {
  for( JoystickButton b : buttons ) {
    if( b.getLogicalId().equals(logicalId) )
      return b;
  }
  return null;
}
origin: jMonkeyEngine/jmonkeyengine

public void setButtonValue( JoystickButton button, boolean isPressed ) {
  System.out.println( "Button:" + button.getName() + "=" + (isPressed ? "Down" : "Up") );
  setButtonValue( button.getLogicalId(), isPressed );
  lastButton = button;
}
origin: jMonkeyEngine/jmonkeyengine

private void pickGamePad(Vector2f mouseLoc){
  if (lastButton != null) {
    CollisionResults cresults = pick(cam, mouseLoc, gamepad);
    for (CollisionResult cr : cresults) {
      Node n = cr.getGeometry().getParent();
      if (n != null && (n instanceof ButtonView)) {
        String b = ((ButtonView) n).getName().substring("Button:".length());
        String name = lastButton.getJoystick().getName().replaceAll(" ", "\\\\ ");
        String id = lastButton.getLogicalId().replaceAll(" ", "\\\\ ");
        System.out.println(name + "." + id + "=" + b);
        return;
      }
    }
  }
}

origin: jMonkeyEngine/jmonkeyengine

addInfo( " '" + b.getName() + "' id:'" + b.getLogicalId() + "'", 0 );
origin: org.jmonkeyengine/jme3-core

@Override
public JoystickButton getButton(String logicalId) {
  for( JoystickButton b : buttons ) {
    if( b.getLogicalId().equals(logicalId) )
      return b;
  }
  return null;
}
origin: jMonkeyEngine-Contributions/Lemur

protected void mapJoystick( Joystick j ) {
  // We attempt to determine what kind of stick it is so
  // that we can provide more intelligent button and axis mappings
  if( j.getAxis(JoystickAxis.Z_ROTATION) != null
    && j.getAxis(JoystickAxis.Z_AXIS) != null ) {
    mapGamepad(j);
    return;
  }
  // Else it's a generic one
  joystickAxisMap.put(j.getXAxis(), Axis.JOYSTICK_X);
  joystickAxisMap.put(j.getYAxis(), Axis.JOYSTICK_Y);
  joystickAxisMap.put(j.getPovXAxis(), Axis.JOYSTICK_HAT_X);
  joystickAxisMap.put(j.getPovYAxis(), Axis.JOYSTICK_HAT_Y);
  for( JoystickButton b : j.getButtons() ) {
    String id = b.getLogicalId();
    if( !Character.isDigit(id.charAt(0)) )
      continue;
    int idVal = Integer.parseInt(id) + 1;
    joystickButtonMap.put(b, new Button("joystick_" + idVal, "Button " + idVal));
  }
}
com.jme3.inputJoystickButtongetLogicalId

Javadoc

Returns the logical identifier of this joystick axis.

Popular methods of JoystickButton

  • getButtonId
    Returns the unique buttonId of this joystick axis within a given InputManager context.
  • getJoystick
    Returns the joystick to which this axis object belongs.
  • assignButton
    Assign the mapping name to receive events from the given button index on the joystick.
  • getName
    Returns the name of this joystick.

Popular in Java

  • Reading from database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • orElseThrow (Optional)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now