JMonkey ActionListeners and Variable Changes


I have been working on a project which integrates JMonkey with a speech recognition system. My speech recognition system currently outputs a string variable of the word I have dictated via microphone. E.g. “Hello” or “Jump”.

Following the ‘Hello Input System’ tutorial as an example, it is possible to bind key presses to actions using jmonkey’s action listeners. I would like to bind a ‘change in variable’ to the action listener so when my variable changes from null to “Hello” after my speech recogniser outputs the variable, the actionListener runs the associated animation. Problem is I can’t find a suitable way to achieve this using the existing actionListeners.

I have built a stand alone property change listener using the libraries java.beans.PropertyChangeListener and import java.beans.PropertyChangeEvent as a test of principle. However I am unable to progress any further.

Is there a suitable Jmonkey listener library which will allow me to achieve what I have described? Any answers/ ideas/ code examples which would allow me to change the ‘Hello Input System’ tutorial to use change of variables as input instead of key presses would be greatly appreciated.


What you need is something similar to the InputManager.

Look how it’s done, make you own PropertyChangeManager with an update method and update it in the simpleUpdate method.

1 Like

Thanks for your advice. In the end I was able to find a solution. I can now control my Jmonkey application using my voice (on a simplistic level at the movement). Also I have a greater understanding of Jmonkey libraries. Once again many thanks.


1 Like

Hey cool, a nice video show case could be very neat :smiley:

@markjohnson1988 can u share your knowledge ,