LuciadCPillar 2023.1.04
luciad::IInputEventCallback Class Referenceabstract

A callback class that is called when a luciad::IInputEvent is fired. More...

#include <luciad/input/IInputEventCallback.h>

Public Member Functions

virtual ~IInputEventCallback ()=default
 
virtual void onEvent (const std::shared_ptr< IInputEvent > &inputEvent)=0
 Implement this method to handle the returned luciad::IInputEvent. More...
 

Static Public Member Functions

static std::shared_ptr< IInputEventCallbackcreate (std::function< void(const std::shared_ptr< IInputEvent > &)> function)
 Creates a default IInputEventCallback instance that delegates the IInputEventCallback::onEvent to the given function. More...
 

Detailed Description

A callback class that is called when a luciad::IInputEvent is fired.

Since
2020.1

Constructor & Destructor Documentation

◆ ~IInputEventCallback()

virtual luciad::IInputEventCallback::~IInputEventCallback ( )
virtualdefault

Member Function Documentation

◆ create()

static std::shared_ptr< IInputEventCallback > luciad::IInputEventCallback::create ( std::function< void(const std::shared_ptr< IInputEvent > &)>  function)
static

Creates a default IInputEventCallback instance that delegates the IInputEventCallback::onEvent to the given function.

This is a convenience method that allows to reduce boiler plate code, and use lambdas.

Parameters
functionthe function that is called by IInputEventCallback::onEvent.
Returns
an IInputEventCallback instance based on the given function.

◆ onEvent()

virtual void luciad::IInputEventCallback::onEvent ( const std::shared_ptr< IInputEvent > &  inputEvent)
pure virtual

Implement this method to handle the returned luciad::IInputEvent.

Parameters
inputEventthe event, cannot be nullptr.