Starting movement with scanner import


I try to make the start condition on a Scanner input.

scan = new Scanner(;
String input = scan.nextLine();
inputManager.addMapping(“play_stop”, input);

if (name.equals(“play_stop”) && keyPressed) {
if (playing) {
playing = false;
} else {
playing = true;;

But it still starts by pressing the “space” Key like it was bevor.

[java] inputManager.addMapping(“play_stop”, new KeyTrigger(KeyInput.KEY_J));[/java]

I just started working with Jmonkey and so I have no idea if it is possible what I try to do.

Please help me! :slight_smile:


This cannot work. is related to the standard input, that is the console.
JMonkey works in some graphical window or full-screen. Thus you don’t have access to the console, except for logging purpose.

You should keep up with JME key events. Way to go…


Hey, ok thanks for your answer. My problem changed :slight_smile: I try to let the programm start by a variable which comes from an other class. So if Pos =1 playing = true. But Pos comes from a “normal” java class. Which has a Gui which is not built with jmonkey…Does this work?
I am absolutly new in jmonkey and hava no idea about what is posible and what not…So please help me, please…