gramods
|
Buttons filter that re-maps button indices to a standard order for application compatibility between tracker systems. More...
#include <ButtonsMapper.hh>
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... | |
![]() | |
virtual std::string | getDefaultKey () override |
Returns the default key, in Configuration, for the Object. More... | |
![]() | |
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 | |
![]() | |
typedef std::chrono::steady_clock | clock |
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.
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
|
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.
void gramods::gmTrack::ButtonsMapper::setButtonsTracker | ( | std::shared_ptr< ButtonsTracker > | bt | ) |
Sets the buttons tracker to re-map.
XML-attribute: buttonsTracker
void gramods::gmTrack::ButtonsMapper::setMainButton | ( | int | idx | ) |
Sets which button to map to main button, as an index starting at zero.
XML-attribute: mainButton
void gramods::gmTrack::ButtonsMapper::setMenuButton | ( | int | idx | ) |
Sets which button to map to menu button, as an index starting at zero.
XML-attribute: menuButton
void gramods::gmTrack::ButtonsMapper::setSecondaryButton | ( | int | idx | ) |
Sets which button to map to secondary button, as an index starting at zero.
XML-attribute: secondaryButton
|
overridevirtual |
Propagates the specified visitor.
Reimplemented from gramods::gmCore::Object.