Confirming basic idea about appstate

So I am new to JMOnkey(First Program) and i would like to make sure I have the correct understanding and a legit appoach for my goal.

Have multiple set of input mode(im making something similar to Google sketchup). I would need different mode of input. For example a mouse drag in a mode for creating shapes would mean resizing where a mouse drag in exploring mode would changing the view angle of the object.

Means of accomplishing the goal:

  1. in the main application instantiate all different appstates for different input mode.
  2. attach all to stateManager
  3. activate the first appstate using setEnabled(true) and disabling everything else
  4. from the first appstate, transition to a second appstate will happen in the onAction in first appstate (for example from exploring mode, clicking on a object brings me to the editing mode of the object) By enabling the target appstate and disabling other appstate

I need some comment or verification about my approach as I am new to this. Maybe I have this appstate thing all wrong lol cuz im a little confused about it. Thanks

Im also not sure how to implement a separate input handle for an appstate … like where i should put it in the appstate

I think you have the right understanding. Just think of AppStates as a means of enabling and disabling different kinds of logic.

Here’s a post with links to good examples of AppState usage: AppState: best practises? - #5 by pspeed

You should look into Lemur input examples, as they do exactly that.

You’ll probably want a parent state with children so that only one or compatible controls are enabled at any one time, too…