gramods
Classes | Public Member Functions | Static Public Attributes | List of all members
gramods::gmTrack::ButtonsMapper Class Reference

Buttons filter that re-maps button indices to a standard order for application compatibility between tracker systems. More...

#include <ButtonsMapper.hh>

Inheritance diagram for gramods::gmTrack::ButtonsMapper:
Inheritance graph
[legend]
Collaboration diagram for gramods::gmTrack::ButtonsMapper:
Collaboration graph
[legend]

Classes

struct  ButtonIdx
 Standard button index, in the ButtonsSample::buttons map, for compatibility. More...
 

Public Member Functions

void setButtonsTracker (std::shared_ptr< ButtonsTracker > bt)
 Sets the buttons tracker to re-map. More...
 
void addMapping (gmCore::size2 m)
 Adds a mapping in the form of two integer indices: from and to button index, respectively. More...
 
void setMainButton (int idx)
 Sets which button to map to main button, as an index starting at zero. More...
 
void setSecondaryButton (int idx)
 Sets which button to map to secondary button, as an index starting at zero. More...
 
void setMenuButton (int idx)
 Sets which button to map to menu button, as an index starting at zero. More...
 
bool getButtons (ButtonsSample &p) override
 Replaces the contents of p with button data. More...
 
void traverse (Visitor *visitor) override
 Propagates the specified visitor. More...
 
- Public Member Functions inherited from gramods::gmTrack::ButtonsTracker
virtual std::string getDefaultKey () override
 Returns the default key, in Configuration, for the Object. More...
 
- Public Member Functions inherited from gramods::gmCore::Object
 Object ()
 Initializes internal data. More...
 
virtual ~Object ()
 Cleaning up internal data. More...
 
virtual void initialize ()
 Called to initialize the Object. More...
 
virtual void accept (Visitor *visitor)
 Calls the visitors apply method with this as argument. More...
 
bool isInitialized ()
 Returns true if the Object is initialized. More...
 

Static Public Attributes

static gramods::gmCore::OFactory::OFactoryInformation _gm_ofi
 

Additional Inherited Members

- Public Types inherited from gramods::gmTrack::ButtonsTracker
typedef std::chrono::steady_clock clock
 

Detailed Description

Buttons filter that re-maps button indices to a standard order for application compatibility between tracker systems.

Preferred order is main button, second button and then menu button, followed by any other button, starting at the least significant bit.

Member Function Documentation

◆ addMapping()

void gramods::gmTrack::ButtonsMapper::addMapping ( gmCore::size2  m)

Adds a mapping in the form of two integer indices: from and to button index, respectively.

XML-attribute: mapping

◆ getButtons()

bool gramods::gmTrack::ButtonsMapper::getButtons ( ButtonsSample p)
overridevirtual

Replaces the contents of p with button data.

Returns true if data could be read, false otherwise. Use sample time to check if data are fresh.

Implements gramods::gmTrack::ButtonsTracker.

◆ setButtonsTracker()

void gramods::gmTrack::ButtonsMapper::setButtonsTracker ( std::shared_ptr< ButtonsTracker bt)

Sets the buttons tracker to re-map.

XML-attribute: buttonsTracker

◆ setMainButton()

void gramods::gmTrack::ButtonsMapper::setMainButton ( int  idx)

Sets which button to map to main button, as an index starting at zero.

XML-attribute: mainButton

◆ setMenuButton()

void gramods::gmTrack::ButtonsMapper::setMenuButton ( int  idx)

Sets which button to map to menu button, as an index starting at zero.

XML-attribute: menuButton

◆ setSecondaryButton()

void gramods::gmTrack::ButtonsMapper::setSecondaryButton ( int  idx)

Sets which button to map to secondary button, as an index starting at zero.

XML-attribute: secondaryButton

◆ traverse()

void gramods::gmTrack::ButtonsMapper::traverse ( Visitor visitor)
overridevirtual

Propagates the specified visitor.

See also
Object::Visitor

Reimplemented from gramods::gmCore::Object.


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