Just about every modern game lets the player customize the input according to their own preferences. This recipe will rely on jMonkeyEngine to do the work for us, and we will use Nifty GUI as a visual aid. We'll use
RawInputListener to work out which keys have been pressed and divide them between key codes and characters using the
The recipe will depend on there being some bindings in
InputManager. If you already have a game, this would not be a problem. If not, it will describe how to add a couple of bindings for the example to work.
Following the pattern from previous recipes, we'll start defining the controls, then move on to the screen, and finally work on the ...