carb::input::subscribeToGamepadEvents
Defined in carb/input/InputUtils.h
-
template<typename Functor>
inline SubscriptionId carb::input::subscribeToGamepadEvents(IInput *input, Gamepad *gamepad, Functor &&functor) Subscribes to the gamepad event stream.
- Parameters
input – The IInput interface.
gamepad – A Gamepad handle, or
nullptr
if subscription to events from all gamepads is desired.functor – An invocable object to be called on each gamepad event. Prototype is
void(const GamepadEvent&)
.
- Returns