InputActionEvent

From previous discussion on the occurance of multiple actions being triggered by key presses, I believe it will be up to the application to determine the best course of action to handle this. Doing so requires more information from the InputHandler.



I’m proposing adding a new class InputActionEvent.



This event class contains lists of the keys pressed and the names of the actions being called.



This class will be created in InputHandler and passed to every action’s processEvent that is valid. There will only be a single Event per InputHandler, and it’s data is reset when needed, this will remove object creation problems.



The user will then have the capability to check in his performAction method to see what keys are pressed and what actions were called. Allowing the action to be handled properly.

Seems like a reasonable idea. I like!

Sounds good and oo-style. Engage :wink:

Ok, it’s ready to go in. List of changes (having to remember as I don’t have the code in front of me).



Added a new class InputActionEvent that contains: KeyInput, MouseInput, time and ArrayList of event names.



All Actions now take InputActionEvent instead of float time.



InputHandlers now build the InputActionEvent object during processing of events handing it off to the actions. This gives the actions a list of the events called, key state, mouse state, and the game time.



This should provide enough information for the user’s actions to make decisions.



Planning on committing tonight.

Will it affect the widget code?

There are no external changes.

Committed.