Hello,
at first, i want to thank the developers for the monkey machine!
Now i want to present the Actioneer, which is an api to manage keybindings. It allows you to define an action and associate it with a shortcut. A shortcut is a sequence of arbitrary input triggers. The last trigger of such sequence is a “terminator” and all preceeding triggers (if any) are “modifiers”.
An action implements the de.wwg.actioneer.ShortcutAction interface (or extends the de.wwg.actioneer.AbstractShortctuAction) and defines what to do on the associated shortcut.
The Actioneer hides the input mapping and listener management from the application programmer, e.g. the following two lines enable the user to press the A-key on the keyboard to execute the action MyAction:
Actioneer actioneer = Actioneer.getActioneer(inputManager);
actioneer.addBinding(new MyAction(), new KeyTrigger(KeyInput.KEY_A));
The Actioneer API lets you:
- Add a binding (action and associated shortcut).
- Replace an action with another action of the same name (exchange of functionality).
- Remove a binding from the Actioneer.
- Change a shortcut associated with an action.
- Backup and restore the current bindings.
- Retrieve the localized bindings to display them e.g. in a dialog.
- Define wether an action should receive analog input or not.
- Use a CompositeKeyTrigger to group the L/R-Triggers, e.g. CompositeKeyTrigger.CONTROL represents KEY_LCONTROL and KEY_RCONTROL.
The source code is javadoced and the Actioneer project can be cloned from https://github.com/ekipur/wwg-actioneer.git.
A demo project is available under https://github.com/ekipur/wwg-actioneer-demo.git (Please read the README.md on how to include the required projects!).
The Actioneer is not intended to replace anything of the input system in jme3, instead it relies on it and is just another approach to handle input.
ekipur