NDEVR
API Documentation
KeyController

A top-level controller that dispatches key events to registered sub-controllers. More...

Inheritance diagram for KeyController:
[legend]
Collaboration diagram for KeyController:
[legend]

Public Member Functions

 KeyController ()
 Constructs the KeyController.
virtual ~KeyController ()
 Destructor.
void addController (UUID id, KeyControllerBase *controller)
 Adds a sub-controller identified by a UUID.
Buffer< KeyControllerBase * > controllers () const
 Returns all registered sub-controllers.
bool hasController (UUID id) const
 Checks whether a sub-controller with the given UUID is registered.
bool processKeyEvent (const KeyEvent &event, DesignObjectLookup *lookup, Camera *camera) override
 Dispatches a key event to all registered sub-controllers.
void removeController (UUID id)
 Removes a sub-controller identified by a UUID.

Static Public Member Functions

static KeyControllerDefaultKeyController ()
 Returns the application-wide default KeyController singleton.

Detailed Description

A top-level controller that dispatches key events to registered sub-controllers.


See also
KeyEvent, MouseController, BasicKeyController

Definition at line 142 of file KeyController.h.

Member Function Documentation

◆ addController()

void KeyController::addController ( UUID id,
KeyControllerBase * controller )

Adds a sub-controller identified by a UUID.

Parameters
[in]idThe unique identifier for the controller.
[in]controllerThe key controller to add.

◆ controllers()

Buffer< KeyControllerBase * > KeyController::controllers ( ) const

Returns all registered sub-controllers.

Returns
A buffer containing pointers to all registered KeyControllerBase instances.

◆ DefaultKeyController()

KeyController & KeyController::DefaultKeyController ( )
static

Returns the application-wide default KeyController singleton.

Returns
A reference to the default KeyController instance.

References KeyController().

◆ hasController()

bool KeyController::hasController ( UUID id) const

Checks whether a sub-controller with the given UUID is registered.

Parameters
[in]idThe unique identifier to check.
Returns
True if a controller with the given ID exists, false otherwise.

◆ processKeyEvent()

bool KeyController::processKeyEvent ( const KeyEvent & event,
DesignObjectLookup * lookup,
Camera * camera )
overridevirtual

Dispatches a key event to all registered sub-controllers.

Parameters
[in]eventThe key event to process.
[in]lookupThe design object lookup context.
[in]cameraThe active camera context.
Returns
True if any sub-controller handled the event, false otherwise.

Implements KeyControllerBase.

◆ removeController()

void KeyController::removeController ( UUID id)

Removes a sub-controller identified by a UUID.

Parameters
[in]idThe unique identifier of the controller to remove.

The documentation for this class was generated from the following file: