use of com.jme3.input.controls.MouseButtonTrigger in project jmonkeyengine by jMonkeyEngine.
the class TestWriteToTexture method simpleInitApp.
@Override
public void simpleInitApp() {
initOpenCL1();
tex = new Texture2D(settings.getWidth(), settings.getHeight(), 1, com.jme3.texture.Image.Format.RGBA8);
Picture pic = new Picture("julia");
pic.setTexture(assetManager, tex, true);
pic.setPosition(0, 0);
pic.setWidth(settings.getWidth());
pic.setHeight(settings.getHeight());
guiNode.attachChild(pic);
initCounter = 0;
flyCam.setEnabled(false);
inputManager.setCursorVisible(true);
inputManager.addMapping("right", new MouseAxisTrigger(MouseInput.AXIS_X, false));
inputManager.addMapping("left", new MouseAxisTrigger(MouseInput.AXIS_X, true));
inputManager.addMapping("up", new MouseAxisTrigger(MouseInput.AXIS_Y, false));
inputManager.addMapping("down", new MouseAxisTrigger(MouseInput.AXIS_Y, true));
inputManager.addMapping("drag", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
inputManager.addListener(this, "right", "left", "up", "down", "drag");
dragging = false;
}
use of com.jme3.input.controls.MouseButtonTrigger in project jmonkeyengine by jMonkeyEngine.
the class TerrainGridTileLoaderTest method initKeys.
private void initKeys() {
// You can map one or several inputs to one named action
this.inputManager.addMapping("Lefts", new KeyTrigger(KeyInput.KEY_A));
this.inputManager.addMapping("Rights", new KeyTrigger(KeyInput.KEY_D));
this.inputManager.addMapping("Ups", new KeyTrigger(KeyInput.KEY_W));
this.inputManager.addMapping("Downs", new KeyTrigger(KeyInput.KEY_S));
this.inputManager.addMapping("Jumps", new KeyTrigger(KeyInput.KEY_SPACE));
this.inputManager.addMapping("pick", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
this.inputManager.addListener(this.actionListener, "Lefts");
this.inputManager.addListener(this.actionListener, "Rights");
this.inputManager.addListener(this.actionListener, "Ups");
this.inputManager.addListener(this.actionListener, "Downs");
this.inputManager.addListener(this.actionListener, "Jumps");
this.inputManager.addListener(this.actionListener, "pick");
}
use of com.jme3.input.controls.MouseButtonTrigger in project jmonkeyengine by jMonkeyEngine.
the class TerrainTestCollision method setupKeys.
private void setupKeys() {
flyCam.setMoveSpeed(50);
inputManager.addMapping("wireframe", new KeyTrigger(KeyInput.KEY_T));
inputManager.addListener(actionListener, "wireframe");
inputManager.addMapping("Lefts", new KeyTrigger(KeyInput.KEY_H));
inputManager.addMapping("Rights", new KeyTrigger(KeyInput.KEY_K));
inputManager.addMapping("Ups", new KeyTrigger(KeyInput.KEY_U));
inputManager.addMapping("Downs", new KeyTrigger(KeyInput.KEY_J));
inputManager.addMapping("Forwards", new KeyTrigger(KeyInput.KEY_Y));
inputManager.addMapping("Backs", new KeyTrigger(KeyInput.KEY_I));
inputManager.addListener(actionListener, "Lefts");
inputManager.addListener(actionListener, "Rights");
inputManager.addListener(actionListener, "Ups");
inputManager.addListener(actionListener, "Downs");
inputManager.addListener(actionListener, "Forwards");
inputManager.addListener(actionListener, "Backs");
inputManager.addMapping("shoot", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
inputManager.addListener(actionListener, "shoot");
inputManager.addMapping("cameraDown", new MouseButtonTrigger(MouseInput.BUTTON_RIGHT));
inputManager.addListener(actionListener, "cameraDown");
}
use of com.jme3.input.controls.MouseButtonTrigger in project jmonkeyengine by jMonkeyEngine.
the class TerrainTestModifyHeight method setupKeys.
private void setupKeys() {
flyCam.setMoveSpeed(100);
inputManager.addMapping("wireframe", new KeyTrigger(KeyInput.KEY_T));
inputManager.addListener(actionListener, "wireframe");
inputManager.addMapping("Raise", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
inputManager.addListener(actionListener, "Raise");
inputManager.addMapping("Lower", new MouseButtonTrigger(MouseInput.BUTTON_RIGHT));
inputManager.addListener(actionListener, "Lower");
}
Aggregations