Using app.setShowSettings(false); causes the app to ignore default WASD input

Repro Steps:

  • Use jMP 3.0beta from the Downloads page (may affect other version)
  • Create a Basic Game project
  • Add the line “app.setShowSettings(false);” just before app.start();
  • Run the project
  • Press any of the WASD keys



    Actual Results: The WASD keys do not move the camera.

    Expected Results: The WASD keys move the fly-by camera.



    Details:

    I noticed then while going through the tutorials, particularly upon reaching Hello Input. By the time I reached this tutorial, I had turned off the settings dialog to get it out of the way. In the Hello Input tutorial, I thought I had typed the code in wrong since J and K did not move the player. This is what I was able to reduce the problem to.



    I’ve been digging around in SimpleApplication, Application, JmeSystem, and SettingsDialog, but nothing has panned out. The only significant difference that this flag makes, as far as I can tell, is that settings are loaded from the registry. However, the only differences in the default settings from what is returned by SettingsDialog are FrameRate, Frequency, Height, Samples, VSync, and Width. None of those should be affect input.



    If this is expected behavior, then what do I need to do for the default WASD handling to function with app.setShowSettings(false)? If not, then what, ultimately, is causing this behavior?



    TIA

no it’s probably that you have vsync enabled when you show the setting but not when you don’t show them.



The real issue is with the timer, with the current timer, at hi frame rate tpf return 0, so the camera won’t move.



a quick fix is to do



setTimer(new NanoTimer());



in your simpleInit method.



This is gonna be fixed very soon.

1 Like

Yes, this takes care of it. Thank you very much!