Tabnine Logo
JoystickButton.getLogicalId
Code IndexAdd Tabnine 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)

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

  • Finding current android device location
  • getSharedPreferences (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • putExtra (Intent)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now