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