Skip to content

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:

  • T Base element type to decorate
  • KEYS OnKey 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:

  • aListener Pointer to the event listener
  • args Arguments forwarded to the base element constructor

function OnKey

Handles key events, catching specified keys.

inline bool evab::KeyCatcher::OnKey (
    Keys aKey
) override

Parameters:

  • aKey The 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