use of com.jme3.input.Joystick in project jmonkeyengine by jMonkeyEngine.
the class TestJoystick method setViewedJoystick.
protected void setViewedJoystick(Joystick stick) {
if (this.viewedJoystick == stick)
return;
if (this.viewedJoystick != null) {
joystickInfo.detachAllChildren();
}
this.viewedJoystick = stick;
if (this.viewedJoystick != null) {
// Draw the hud
yInfo = 0;
addInfo("Joystick:\"" + stick.getName() + "\" id:" + stick.getJoyId(), 0);
yInfo -= 5;
float ySave = yInfo;
// Column one for the buttons
addInfo("Buttons:", 0);
for (JoystickButton b : stick.getButtons()) {
addInfo(" '" + b.getName() + "' id:'" + b.getLogicalId() + "'", 0);
}
yInfo = ySave;
// Column two for the axes
addInfo("Axes:", 1);
for (JoystickAxis a : stick.getAxes()) {
addInfo(" '" + a.getName() + "' id:'" + a.getLogicalId() + "' analog:" + a.isAnalog(), 1);
}
}
}
use of com.jme3.input.Joystick in project jmonkeyengine by jMonkeyEngine.
the class VRApplication method initInput.
/**
* Initializes mouse and keyboard input. Also
* initializes joystick input if joysticks are enabled in the
* AppSettings.
*/
private void initInput() {
mouseInput = context.getMouseInput();
if (mouseInput != null)
mouseInput.initialize();
keyInput = context.getKeyInput();
if (keyInput != null)
keyInput.initialize();
touchInput = context.getTouchInput();
if (touchInput != null)
touchInput.initialize();
if (!settings.getBoolean("DisableJoysticks")) {
joyInput = context.getJoyInput();
if (joyInput != null)
joyInput.initialize();
}
inputManager = new InputManager(mouseInput, keyInput, joyInput, touchInput);
}
Aggregations