Call to InputAction

Is there a good way to call an InputAction from within the application, not in response to user input. In other words I have a class which extends "KeyInputAction" and is normally called on user keyboard input. I would also like to call this action from within my application code (not based on user input) without duplicating the existing function into a new method. Any suggestions?



Thanks!

calling performAction?

yes, duh… thanks.



my problem was that i was extending simpleGame for a test case and overwriting "input" with my own custom InputHandler class. my main application could not recognize the inputAction in my custom InputHandler class… probably because "input" was originally instantiated as "InputHandler" in SimpleGame (not as my custom extended class of InputHandler). is there any way around this for simple test cases, or will i always have to create a new inputhandler in simplegame as opposed to overwriting "input"?



i am simply overwriting "input" in the initGame method as follows:

input = new DSInputHandler(player, properties.getRenderer());



but my compiler still thinks that "input" is an instance of InputHandler as opposed to DSInputHandler.



sorry if this question seems convoluted. i've already found a workaround but was just curious if i'm overlooking something simple.



thanks for the quick reply… JME and the community is great!

You must use a cast ((DSInputHandler)input) since input is defined as InputHandler in the superclass