Skip to content

Fiddling around with a C API for universal input actions

License

Notifications You must be signed in to change notification settings

larsiusprime/ActionPact

Repository files navigation

ActionPact

Fiddling around with a C API for universal input actions

Initialization:

//Initialize a new manager from the given configuration
ActionManager manager = ActionManager.fromConfig("path");

Every frame:

manager.update(elapsed_time_in_ms);

Working with a backend:

SDLBackend sdl = new SDLBackend();
manager.addBackend(sdl);

ActionSet basic = manager.getActionSet("basic");
ActionDigital jump = basic.getAction("jump");

SDLDigitalInput leftMouse = new SDLBackend.getMouseInput(LEFT_MB, JUST_PRESSED);
SDLDigitalInput spaceBar = new SDLBackend.getKeyInput(SPACEBAR, JUST_PRESSED);
SDLDigitalInput aButton = new SDLBackend.getGamepad(A_BUTTON, JUST_PRESSED, FIRST_ACTIVE);

jump.addInput(leftMouse);
jump.addInput(spaceBar);
jump.addInput(aButton);

About

Fiddling around with a C API for universal input actions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published