Skip to content

Instantly share code, notes, and snippets.

@jwoertink
Created September 19, 2011 23:18
Show Gist options
  • Save jwoertink/1227877 to your computer and use it in GitHub Desktop.
Save jwoertink/1227877 to your computer and use it in GitHub Desktop.
/* Unnecessary code removed */
package jme3test.helloworld;
import com.jme3.app.SimpleApplication;
import com.jme3.input.controls.ActionListener;
public class HelloInput extends SimpleApplication {
public static void main(String[] args) {
HelloInput app = new HelloInput();
}
private void initKeys() {
inputManager.addListener(actionListener, new String[]{"Pause"});
}
private ActionListener actionListener = new ActionListener() {
public void onAction(String name, boolean keyPressed, float tpf) {
if (name.equals("Pause") && !keyPressed) {
isRunning = !isRunning;
}
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment