nomlib
Loading...
Searching...
No Matches
nom::InputAction Class Reference

Base class for mapping an action to an input device. More...

#include <InputAction.hpp>

Inheritance diagram for nom::InputAction:
[legend]

Public Member Functions

 InputAction ()
 Default constructor; constructs an invalid action state.
virtual const Eventevent (void) const
 Get the underlying event associated with the input action.
const nom::event_callback & callback (void) const
 Get the callback assigned to the input action.
void set_callback (const nom::event_callback &delegate)
void operator() (const Event &evt) const
 C++ functor; execute the callback assigned for the input action.

Public Attributes

Event event_
 The event type and relevant input data; the criteria is used to match against user input.

Private Attributes

nom::event_callback callback_
 The delegate to call upon a successful action to event match.

Detailed Description

Base class for mapping an action to an input device.

Remarks
See also nom::InputMapper, nom::InputContext, nom::InputState

Definition at line 41 of file InputAction.hpp.

Member Function Documentation

◆ event()

virtual const Event & nom::InputAction::event ( void ) const
virtual

Get the underlying event associated with the input action.

Remarks
The event returned is "fake" – it is used as the action's data fields for matching against the real user input.

Member Data Documentation

◆ callback_

nom::event_callback nom::InputAction::callback_
private

The delegate to call upon a successful action to event match.

Definition at line 69 of file InputAction.hpp.

◆ event_

Event nom::InputAction::event_

The event type and relevant input data; the criteria is used to match against user input.

Definition at line 65 of file InputAction.hpp.


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