#include <Leap.h>
The Config class provides access to Leap system configuration information.
You can get and set gesture configuration parameters using the Config object obtained from a connected Controller object. The key strings required to identify a configuration parameter include:
Key string | Value type | Default value | Units |
---|---|---|---|
Gesture.Circle.MinRadius | float | 5.0 | mm |
Gesture.Circle.MinArc | float | 1.5*pi | radians |
Gesture.Swipe.MinLength | float | 150 | mm |
Gesture.Swipe.MinVelocity | float | 1000 | mm/s |
Gesture.KeyTap.MinDownVelocity | float | 50 | mm/s |
Gesture.KeyTap.HistorySeconds | float | 0.1 | s |
Gesture.KeyTap.MinDistance | float | 3.0 | mm |
Gesture.ScreenTap.MinForwardVelocity | float | 50 | mm/s |
Gesture.ScreenTap.HistorySeconds | float | 0.1 | s |
Gesture.ScreenTap.MinDistance | float | 5.0 | mm |
After setting a configuration value, you must call the Config::save method to commit the changes. The configuration value changes are not persistent; your application needs to set the values every time it runs.
Public Member Functions | |
LEAP_EXPORT | Config () |
LEAP_EXPORT ValueType | type (const std::string &key) const |
LEAP_EXPORT bool | getBool (const std::string &key) const |
LEAP_EXPORT bool | setBool (const std::string &key, bool value) |
LEAP_EXPORT int32_t | getInt32 (const std::string &key) const |
LEAP_EXPORT bool | setInt32 (const std::string &key, int32_t value) |
LEAP_EXPORT float | getFloat (const std::string &key) const |
LEAP_EXPORT bool | setFloat (const std::string &key, float value) |
LEAP_EXPORT std::string | getString (const std::string &key) const |
LEAP_EXPORT bool | setString (const std::string &key, const std::string &value) |
LEAP_EXPORT bool | save () |
Additional Inherited Members | |
![]() | |
class SharedObject * | m_object |
![]() | |
LEAP_EXPORT | Interface (void *owner) |
LEAP_EXPORT | Interface (Implementation *reference, void *owner) |
LEAP_EXPORT | Interface (const Interface &rhs) |
LEAP_EXPORT Interface & | operator= (const Interface &rhs) |
virtual LEAP_EXPORT | ~Interface () |
template<typename T > | |
T * | get () const |
LEAP_EXPORT Leap::Config::Config | ( | ) |
Constructs a Config object.
LEAP_EXPORT bool Leap::Config::getBool | ( | const std::string & | key | ) | const |
Gets the boolean representation for the specified key.
LEAP_EXPORT float Leap::Config::getFloat | ( | const std::string & | key | ) | const |
Gets the floating point representation for the specified key.
LEAP_EXPORT int32_t Leap::Config::getInt32 | ( | const std::string & | key | ) | const |
Gets the 32-bit integer representation for the specified key.
LEAP_EXPORT std::string Leap::Config::getString | ( | const std::string & | key | ) | const |
Gets the string representation for the specified key.
LEAP_EXPORT bool Leap::Config::save | ( | ) |
Saves the current state of the config.
Call save()
after making a set of configuration changes. The save()
function transfers the configuration changes to the Leap application. The configuration value changes are not persistent; your application needs to set the values every time it runs.
LEAP_EXPORT bool Leap::Config::setBool | ( | const std::string & | key, |
bool | value | ||
) |
Sets the boolean representation for the specified key.
LEAP_EXPORT bool Leap::Config::setFloat | ( | const std::string & | key, |
float | value | ||
) |
Sets the floating point representation for the specified key.
LEAP_EXPORT bool Leap::Config::setInt32 | ( | const std::string & | key, |
int32_t | value | ||
) |
Sets the 32-bit integer representation for the specified key.
LEAP_EXPORT bool Leap::Config::setString | ( | const std::string & | key, |
const std::string & | value | ||
) |
Sets the string representation for the specified key.
LEAP_EXPORT ValueType Leap::Config::type | ( | const std::string & | key | ) | const |
Reports the natural data type for the value related to the specified key.
key | The key for the looking up the value in the configuration dictionary. |
Enumerates the possible data types for configuration values.
The Config::type() function returns an item from the ValueType enumeration.
Enumerator | |
---|---|
TYPE_UNKNOWN | The data type is unknown. |
TYPE_BOOLEAN | A boolean value. |
TYPE_INT32 | A 32-bit integer. |
TYPE_FLOAT | A floating-point number. |
TYPE_STRING | A string of characters. |