#include <Leap.h>
Public Types | |
enum | ValueType { TYPE_UNKNOWN = 0, TYPE_BOOLEAN = 1, TYPE_INT32 = 2, TYPE_FLOAT = 6, TYPE_STRING = 8 } |
Public Member Functions | |
def | __init__ |
LEAP_EXPORT | Config () |
def | get |
bool | getBool (const std::string &key) const |
float | getFloat (const std::string &key) const |
int32_t | getInt32 (const std::string &key) const |
std::string | getString (const std::string &key) const |
def | save |
LEAP_EXPORT bool | save () |
def | set |
bool | setBool (const std::string &key, bool value) |
bool | setFloat (const std::string &key, float value) |
bool | setInt32 (const std::string &key, int32_t value) |
bool | setString (const std::string &key, const std::string &value) |
ValueType | type (const std::string &key) const |
Public Attributes | |
this | |
Static Public Attributes | |
TYPE_BOOLEAN = LeapPython.Config_TYPE_BOOLEAN | |
TYPE_FLOAT = LeapPython.Config_TYPE_FLOAT | |
TYPE_INT32 = LeapPython.Config_TYPE_INT32 | |
TYPE_STRING = LeapPython.Config_TYPE_STRING | |
TYPE_UNKNOWN = LeapPython.Config_TYPE_UNKNOWN | |
Private Member Functions | |
LEAP_EXPORT bool | getBoolCString (const char *key) const |
LEAP_EXPORT float | getFloatCString (const char *key) const |
LEAP_EXPORT int32_t | getInt32CString (const char *key) const |
LEAP_EXPORT const char * | getStringCString (const char *key) const |
LEAP_EXPORT bool | setBoolCString (const char *key, bool value) |
LEAP_EXPORT bool | setFloatCString (const char *key, float value) |
LEAP_EXPORT bool | setInt32CString (const char *key, int32_t value) |
LEAP_EXPORT bool | setStringCString (const char *key, const char *value) |
LEAP_EXPORT ValueType | typeCString (const char *key) const |
Static Private Attributes | |
tuple | __getattr__ = lambdaself,name:_swig_getattr(self, Config, name) |
__repr__ = _swig_repr | |
tuple | __setattr__ = lambdaself,name,value:_swig_setattr(self, Config, name, value) |
__swig_destroy__ = LeapPython.delete_Config | |
dictionary | __swig_getmethods__ = {} |
dictionary | __swig_setmethods__ = {} |
The Config class provides access to Leap Motion 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. You can save after the Controller has connected to the Leap Motion service/daemon. In other words, after the Controller has dispatched the serviceConnected or connected events or Controller::isConnected is true. The configuration value changes are not persistent; your application needs to set the values every time it runs.
Enumerates the possible data types for configuration values.
The Config::type() function returns an item from the ValueType enumeration.
Constructs a Config object. Do not create your own Config objects. Get a Config object using the Controller::config() function.
def Leap::Config::__init__ | ( | self | ) |
def Leap::Config::get | ( | self, | |
args | |||
) |
bool Leap::Config::getBool | ( | const std::string & | key | ) | const [inline] |
LEAP_EXPORT bool Leap::Config::getBoolCString | ( | const char * | key | ) | const [private] |
float Leap::Config::getFloat | ( | const std::string & | key | ) | const [inline] |
LEAP_EXPORT float Leap::Config::getFloatCString | ( | const char * | key | ) | const [private] |
int32_t Leap::Config::getInt32 | ( | const std::string & | key | ) | const [inline] |
LEAP_EXPORT int32_t Leap::Config::getInt32CString | ( | const char * | key | ) | const [private] |
std::string Leap::Config::getString | ( | const std::string & | key | ) | const [inline] |
LEAP_EXPORT const char* Leap::Config::getStringCString | ( | const char * | key | ) | const [private] |
def Leap::Config::save | ( | self | ) |
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 Motion service. You can save after the Controller has connected to the Leap Motion service/daemon. In other words, after the Controller has dispatched the serviceConnected or connected events or Controller::isConnected is true. The configuration value changes are not persistent; your application must set the values every time it runs.
def Leap::Config::set | ( | self, | |
args | |||
) |
bool Leap::Config::setBool | ( | const std::string & | key, |
bool | value | ||
) | [inline] |
LEAP_EXPORT bool Leap::Config::setBoolCString | ( | const char * | key, |
bool | value | ||
) | [private] |
bool Leap::Config::setFloat | ( | const std::string & | key, |
float | value | ||
) | [inline] |
LEAP_EXPORT bool Leap::Config::setFloatCString | ( | const char * | key, |
float | value | ||
) | [private] |
bool Leap::Config::setInt32 | ( | const std::string & | key, |
int32_t | value | ||
) | [inline] |
LEAP_EXPORT bool Leap::Config::setInt32CString | ( | const char * | key, |
int32_t | value | ||
) | [private] |
bool Leap::Config::setString | ( | const std::string & | key, |
const std::string & | value | ||
) | [inline] |
LEAP_EXPORT bool Leap::Config::setStringCString | ( | const char * | key, |
const char * | value | ||
) | [private] |
ValueType Leap::Config::type | ( | const std::string & | key | ) | const [inline] |
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. |
LEAP_EXPORT ValueType Leap::Config::typeCString | ( | const char * | key | ) | const [private] |
tuple Leap::Config::__getattr__ = lambdaself,name:_swig_getattr(self, Config, name) [static, private] |
Reimplemented from Leap::Interface.
Leap::Config::__repr__ = _swig_repr [static, private] |
tuple Leap::Config::__setattr__ = lambdaself,name,value:_swig_setattr(self, Config, name, value) [static, private] |
Reimplemented from Leap::Interface.
Leap::Config::__swig_destroy__ = LeapPython.delete_Config [static, private] |
dictionary Leap::Config::__swig_getmethods__ = {} [static, private] |
Reimplemented from Leap::Interface.
dictionary Leap::Config::__swig_setmethods__ = {} [static, private] |
Reimplemented from Leap::Interface.
Leap::Config::TYPE_BOOLEAN = LeapPython.Config_TYPE_BOOLEAN [static] |
Leap::Config::TYPE_FLOAT = LeapPython.Config_TYPE_FLOAT [static] |
Leap::Config::TYPE_INT32 = LeapPython.Config_TYPE_INT32 [static] |
Leap::Config::TYPE_STRING = LeapPython.Config_TYPE_STRING [static] |
Leap::Config::TYPE_UNKNOWN = LeapPython.Config_TYPE_UNKNOWN [static] |