Getting key and mouse actions without polling in StandardGame

Hey,



I am currently handling mouse input and keyboard input using the following tutorial:



https://wiki.jmonkeyengine.org/legacy/doku.php/gamecontrol_basics



Here, all actions are bound in the constructor and a new thread continuously calls the update function where every action is polled. Is there a more efficient way to implement this using StandardGame. For example, a function being called every time an action happens and passing the event as an argument?



Also, doing it the above way makes it difficult to only do something when the mouse is clicked. Instead of doing it when the mouse is clicked, and while it is pressed down. To get the former it looks like I would have to create a variable for every possible mouse or key binding and store the last action etc. :frowning:



Many thanks



Toshi