Orxonox: orxonox::Button Class Reference

# orxonox::Button Class Reference

`#include <src/core/input/Button.h>`

Inheritance diagram for orxonox::Button:

List of all members.

## Public Member Functions

virtual bool | addParamCommand (ParamCommand *command)
| Button ()
virtual void | clear ()
bool | execute (KeybindMode::Value mode, float abs=1.0f, float rel=1.0f)
void | parse ()
void | readConfigValue (ConfigFileType configFile)
virtual | ~Button ()

## Public Attributes

bool | bButtonThresholdUser_
std::string | bindingString_
| The configured string value.
float | buttonThreshold_
BaseCommand ** | commands_ [3]
| Basic commands for OnPress, OnHold and OnRelease.
ConfigValueContainer * | configContainer_
| Container to allow for better configValue support.
std::string | groupName_
| Name of the group of input triggers.
std::string | name_
| Name of the trigger as strings.
unsigned int | nCommands_ [3]
| Number of basic commands.
std::vector < BufferedParamCommand * > * | paramCommandBuffer_
| Pointer to the list of parametrised commands.

## Private Member Functions

void | parseError (std::string message, bool serious)

## Constructor & Destructor Documentation

orxonox::Button::Button | ( |  | ) |

Note:
  bButtonThresholdUser_: We set it to true so that setConfigValues in KeyBinder sets the value correctly the first time. It is then set to false first and changed later in Button::parse().

References clear(), configContainer_, and nCommands_.

orxonox::Button::~Button | ( |  | ) | `[virtual]`

References clear(), and configContainer_.

## Member Function Documentation

virtual bool orxonox::Button::addParamCommand | ( | ParamCommand * | command | ) | `[inline, virtual]`

Reimplemented in orxonox::HalfAxis.

Referenced by parse().

void orxonox::Button::clear | ( |  | ) | `[virtual]`

Reimplemented in orxonox::HalfAxis.

References commands_, and nCommands_.

Referenced by Button(), orxonox::HalfAxis::clear(), parse(), and ~Button().

bool orxonox::Button::execute | ( | KeybindMode::Value | mode,
|  | float | abs = `1.0f`,
|  | float | rel = `1.0f` |
| ) |  |  | `[inline]`

References commands_, and nCommands_.

Referenced by orxonox::KeyBinder::keyHeld(), orxonox::KeyBinder::keyPressed(), orxonox::KeyBinder::keyReleased(), orxonox::KeyBinder::mouseButtonHeld(), orxonox::KeyBinder::mouseButtonPressed(), and orxonox::KeyBinder::mouseButtonReleased().

void orxonox::Button::parse | ( |  | ) |

References addParamCommand(), bButtonThresholdUser_, bindingString_, buttonThreshold_, clear(), commands_, orxonox::convertValue(), orxonox::CommandExecutor::evaluate(), orxonox::SimpleCommand::evaluation_, orxonox::BufferedParamCommand::evaluation_, orxonox::CommandEvaluation::getConsoleCommand(), orxonox::ConsoleCommand::getInputConfiguredParam_(), orxonox::ConsoleCommand::getKeybindMode(), orxonox::getLowercase(), orxonox::isEmpty(), orxonox::CommandEvaluation::isValid(), nCommands_, orxonox::KeybindMode::None, orxonox::KeybindMode::OnHold, orxonox::KeybindMode::OnPress, orxonox::KeybindMode::OnRelease, orxonox::ParamCommand::paramCommand_, paramCommandBuffer_, orxonox::BufferedParamCommand::paramIndex_, parseError(), orxonox::ParamCommand::scale_, orxonox::SubString::size(), and orxonox::SubString::WhiteSpaces.

Referenced by readConfigValue().

void orxonox::Button::parseError | ( | std::string | message,
|  | bool | serious |
| ) |  |  | `[inline, private]`

References COUT, and name_.

Referenced by parse().

void orxonox::Button::readConfigValue | ( | ConfigFileType | configFile | ) |

References bindingString_, orxonox::ConfigValueContainer::callback(), configContainer_, orxonox::ConfigValueContainer::getValue(), groupName_, name_, and parse().

## Member Data Documentation

bool orxonox::Button::bButtonThresholdUser_

Referenced by parse().

std::string orxonox::Button::bindingString_

The configured string value.

Referenced by parse(), and readConfigValue().

float orxonox::Button::buttonThreshold_

Says how much it takes for an analog axis to trigger a button Note: This variable is here to have only one parse() function.

Referenced by parse(), and orxonox::KeyBinder::tickHalfAxis().

BaseCommand** orxonox::Button::commands_[3]

Basic commands for OnPress, OnHold and OnRelease.

Referenced by clear(), execute(), and parse().

ConfigValueContainer* orxonox::Button::configContainer_

Container to allow for better configValue support.

Referenced by Button(), readConfigValue(), and ~Button().

std::string orxonox::Button::groupName_

Name of the group of input triggers.

Referenced by orxonox::KeyBinder::KeyBinder(), and readConfigValue().

std::string orxonox::Button::name_

Name of the trigger as strings.

Referenced by orxonox::KeyBinder::compilePointerLists(), orxonox::KeyBinder::KeyBinder(), orxonox::KeyBinder::keyHeld(), orxonox::KeyBinder::keyPressed(), orxonox::KeyBinder::keyReleased(), parseError(), and readConfigValue().

unsigned int orxonox::Button::nCommands_[3]

Number of basic commands.

Referenced by Button(), clear(), execute(), parse(), and orxonox::KeyBinder::tickHalfAxis().

std::vector<BufferedParamCommand*>* orxonox::Button::paramCommandBuffer_

Pointer to the list of parametrised commands.

Referenced by orxonox::KeyBinder::KeyBinder(), and parse().

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

- src/core/input/Button.h
- src/core/input/Button.cc