39 enum class ButtonState : uint8_t {
45 ButtonState buttonPressed[jngl::controller::Last] = { ButtonState::UNKNOWN };
Object representing one Gamepad controller.
virtual bool down(controller::Button) const =0
Returns true when the button is down.
virtual void rumble(float, std::chrono::milliseconds)
0 = no vibration, 1 = maximum
bool pressed(controller::Button)
Returns true only once per frame (until jngl::updateInput is called) for every button press.
float state(controller::Button) const
Returns a value between 0.0f (not pressed) and 1.0f (pressed)
Controller()=default
Use jngl::getConnectedControllers() to query available controllers.