Class evab::KeyCatcher¶
template <class T, Keys... KEYS>
ClassList > evab > KeyCatcher
Decorator that catches specified key events and forwards them to a listener. More...
#include <evabKeyCatcher.h>
Inherits the following classes: T
Public Functions¶
| Type | Name |
|---|---|
| KeyCatcher (eva::IHandler * aListener, Args &&... args) Constructor for KeyCatcher . |
|
| bool | OnKey (Keys aKey) override Handles key events, catching specified keys. |
Detailed Description¶
This class wraps any element and intercepts key presses matching the specified keys. When a matching key is pressed, it invokes the listener with an event callback.
Template parameters:
TBase element type to decorateKEYSOnKey codes to catch (variadic template parameters)
Public Functions Documentation¶
function KeyCatcher¶
Constructor for KeyCatcher .
template<typename... Args>
inline evab::KeyCatcher::KeyCatcher (
eva::IHandler * aListener,
Args &&... args
)
Parameters:
aListenerPointer to the event listenerargsArguments forwarded to the base element constructor
function OnKey¶
Handles key events, catching specified keys.
inline bool evab::KeyCatcher::OnKey (
Keys aKey
) override
Parameters:
aKeyThe key code to process
Returns:
true if the key was handled, false otherwise
The documentation for this class was generated from the following file src/evabKeyCatcher.h