Hi.
I use a JCanvasImplementor, NOT any AbstractGame class. So I try to init all InputHandlers
What is wrong with this code?
Thanks,
Equilibrium
MouseInput.setProvider(InputSystem.INPUT_SYSTEM_LWJGL);
KeyInput.setProvider(InputSystem.INPUT_SYSTEM_LWJGL);
InputHandler inputHandler = new InputHandler();
InputAction inputAction = new InputAction() {
public void performAction(InputActionEvent evt) {
System.out.println("This should be printed if space is pressed, but isn't. Why?");
}
};
KeyBindingManager keyboard = KeyBindingManager.getKeyBindingManager();
keyboard.set("space", KeyInput.KEY_SPACE);
inputHandler.addAction(inputAction, "space", false);
inputHandler.setEnabled(true);