Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <AddonButtonMap.h>
Public Member Functions | |
CAddonButtonMap (CPeripheral *device, const std::weak_ptr< CPeripheralAddon > &addon, const std::string &strControllerId, CPeripherals &manager) | |
~CAddonButtonMap (void) override | |
std::string | ControllerID (void) const override |
The add-on ID of the game controller associated with this button map. | |
std::string | Location (void) const override |
The Location of the peripheral associated with this button map. | |
bool | Load (void) override |
Load the button map into memory. | |
void | Reset (void) override |
Reset the button map to its defaults, or clear button map if no defaults. | |
bool | IsEmpty (void) const override |
Check if the button map is empty. | |
std::string | GetAppearance () const override |
Get the ID of the controller profile that best represents the appearance of the peripheral. | |
bool | SetAppearance (const std::string &controllerId) const override |
Set the ID of the controller that best represents the appearance of the peripheral. | |
bool | GetFeature (const KODI::JOYSTICK::CDriverPrimitive &primitive, KODI::JOYSTICK::FeatureName &feature) override |
Get the feature associated with a driver primitive. | |
KODI::JOYSTICK::FEATURE_TYPE | GetFeatureType (const KODI::JOYSTICK::FeatureName &feature) override |
Get the type of the feature for the given name. | |
bool | GetScalar (const KODI::JOYSTICK::FeatureName &feature, KODI::JOYSTICK::CDriverPrimitive &primitive) override |
Get the driver primitive for a scalar feature. | |
void | AddScalar (const KODI::JOYSTICK::FeatureName &feature, const KODI::JOYSTICK::CDriverPrimitive &primitive) override |
Add or update a scalar feature. | |
bool | GetAnalogStick (const KODI::JOYSTICK::FeatureName &feature, KODI::JOYSTICK::ANALOG_STICK_DIRECTION direction, KODI::JOYSTICK::CDriverPrimitive &primitive) override |
Get an analog stick direction from the button map. | |
void | AddAnalogStick (const KODI::JOYSTICK::FeatureName &feature, KODI::JOYSTICK::ANALOG_STICK_DIRECTION direction, const KODI::JOYSTICK::CDriverPrimitive &primitive) override |
Add or update an analog stick direction. | |
bool | GetRelativePointer (const KODI::JOYSTICK::FeatureName &feature, KODI::JOYSTICK::RELATIVE_POINTER_DIRECTION direction, KODI::JOYSTICK::CDriverPrimitive &primitive) override |
Get a relative pointer direction from the button map. | |
void | AddRelativePointer (const KODI::JOYSTICK::FeatureName &feature, KODI::JOYSTICK::RELATIVE_POINTER_DIRECTION direction, const KODI::JOYSTICK::CDriverPrimitive &primitive) override |
Add or update a relative pointer direction. | |
bool | GetAccelerometer (const KODI::JOYSTICK::FeatureName &feature, KODI::JOYSTICK::CDriverPrimitive &positiveX, KODI::JOYSTICK::CDriverPrimitive &positiveY, KODI::JOYSTICK::CDriverPrimitive &positiveZ) override |
Get an accelerometer from the button map. | |
void | AddAccelerometer (const KODI::JOYSTICK::FeatureName &feature, const KODI::JOYSTICK::CDriverPrimitive &positiveX, const KODI::JOYSTICK::CDriverPrimitive &positiveY, const KODI::JOYSTICK::CDriverPrimitive &positiveZ) override |
Get or update an accelerometer. | |
bool | GetWheel (const KODI::JOYSTICK::FeatureName &feature, KODI::JOYSTICK::WHEEL_DIRECTION direction, KODI::JOYSTICK::CDriverPrimitive &primitive) override |
Get a wheel direction from the button map. | |
void | AddWheel (const KODI::JOYSTICK::FeatureName &feature, KODI::JOYSTICK::WHEEL_DIRECTION direction, const KODI::JOYSTICK::CDriverPrimitive &primitive) override |
Add or update a wheel direction. | |
bool | GetThrottle (const KODI::JOYSTICK::FeatureName &feature, KODI::JOYSTICK::THROTTLE_DIRECTION direction, KODI::JOYSTICK::CDriverPrimitive &primitive) override |
Get a throttle direction from the button map. | |
void | AddThrottle (const KODI::JOYSTICK::FeatureName &feature, KODI::JOYSTICK::THROTTLE_DIRECTION direction, const KODI::JOYSTICK::CDriverPrimitive &primitive) override |
Add or update a throttle direction. | |
bool | GetKey (const KODI::JOYSTICK::FeatureName &feature, KODI::JOYSTICK::CDriverPrimitive &primitive) override |
Get the driver primitive for a keyboard key. | |
void | AddKey (const KODI::JOYSTICK::FeatureName &feature, const KODI::JOYSTICK::CDriverPrimitive &primitive) override |
Add or update a key. | |
void | SetIgnoredPrimitives (const std::vector< KODI::JOYSTICK::CDriverPrimitive > &primitives) override |
Set a list of driver primitives to be ignored. | |
bool | IsIgnored (const KODI::JOYSTICK::CDriverPrimitive &primitive) override |
Check if a primitive is in the list of primitives to be ignored. | |
bool | GetAxisProperties (unsigned int axisIndex, int ¢er, unsigned int &range) override |
Get the properties of an axis. | |
void | SaveButtonMap () override |
Save the button map. | |
void | RevertButtonMap () override |
Revert changes to the button map since the last time it was loaded or committed to disk. | |
Public Member Functions inherited from KODI::JOYSTICK::IButtonMap | |
virtual | ~IButtonMap ()=default |
CAddonButtonMap::CAddonButtonMap | ( | CPeripheral * | device, |
const std::weak_ptr< CPeripheralAddon > & | addon, | ||
const std::string & | strControllerId, | ||
CPeripherals & | manager ) |
|
override |
|
overridevirtual |
Get or update an accelerometer.
feature | Must be an accelerometer or this will return false |
positiveX | The semiaxis corresponding to the positive X direction |
positiveY | The semiaxis corresponding to the positive Y direction |
positiveZ | The semiaxis corresponding to the positive Z direction |
The driver primitives must be mapped to a semiaxis or this function will fail.
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Add or update an analog stick direction.
feature | Must be an analog stick or this will return false |
direction | The direction being mapped |
primitive | The driver primitive for the specified analog stick and direction |
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Add or update a key.
feature | Must be a key |
primitive | The feature's driver primitive |
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Add or update a relative pointer direction.
feature | Must be a relative pointer or this will return false |
direction | The direction being mapped |
primitive | The driver primitive for the specified analog stick and direction |
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Add or update a scalar feature.
feature | Must be a scalar feature |
primitive | The feature's driver primitive |
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Add or update a throttle direction.
feature | Must be a throttle or this will return false |
direction | The direction being mapped |
primitive | The driver primitive for the specified analog stick and direction |
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Add or update a wheel direction.
feature | Must be a wheel or this will return false |
direction | The direction being mapped |
primitive | The driver primitive for the specified analog stick and direction |
Implements KODI::JOYSTICK::IButtonMap.
|
inlineoverridevirtual |
The add-on ID of the game controller associated with this button map.
The controller ID provided by the implementation serves as the context for the feature names below.
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Get an accelerometer from the button map.
feature | Must be an accelerometer or this will return false |
positiveX | The semiaxis mapped to the positive X direction (possibly unknown) |
positiveY | The semiaxis mapped to the positive Y direction (possibly unknown) |
positiveZ | The semiaxis mapped to the positive Z direction (possibly unknown) |
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Get an analog stick direction from the button map.
feature | Must be an analog stick or this will return false | |
direction | The direction whose primitive is to be retrieved | |
[out] | primitive | The primitive mapped to the specified direction |
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Get the ID of the controller profile that best represents the appearance of the peripheral.
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Get the properties of an axis.
axisIndex | The index of the axis to check |
center[out] | The center, if known |
range[out] | The range, if known |
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Get the feature associated with a driver primitive.
Multiple primitives can be mapped to the same feature. For example, analog sticks use one primitive for each direction.
primitive | The driver primitive |
feature | The name of the resolved joystick feature, or invalid if false is returned |
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Get the type of the feature for the given name.
feature | The feature to look up |
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Get the driver primitive for a keyboard key.
feature | Must be a key |
primitive | The resolved driver primitive |
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Get a relative pointer direction from the button map.
feature | Must be a relative pointer stick or this will return false | |
direction | The direction whose primitive is to be retrieved | |
[out] | primitive | The primitive mapped to the specified direction |
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Get the driver primitive for a scalar feature.
When a feature can be represented by a single driver primitive, it is called a scalar feature.
feature | Must be a scalar feature (a feature that only requires a single driver primitive) |
primitive | The resolved driver primitive |
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Get a throttle direction from the button map.
feature | Must be a throttle or this will return false | |
direction | The direction whose primitive is to be retrieved | |
[out] | primitive | The primitive mapped to the specified direction |
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Get a wheel direction from the button map.
feature | Must be a wheel or this will return false | |
direction | The direction whose primitive is to be retrieved | |
[out] | primitive | The primitive mapped to the specified direction |
Implements KODI::JOYSTICK::IButtonMap.
Check if the button map is empty.
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Check if a primitive is in the list of primitives to be ignored.
primitive | The primitive to check |
Implements KODI::JOYSTICK::IButtonMap.
Load the button map into memory.
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
The Location of the peripheral associated with this button map.
Implements KODI::JOYSTICK::IButtonMap.
Reset the button map to its defaults, or clear button map if no defaults.
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Revert changes to the button map since the last time it was loaded or committed to disk.
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Save the button map.
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Set the ID of the controller that best represents the appearance of the peripheral.
controllerId | The controller ID, or empty to unset the appearance |
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
Set a list of driver primitives to be ignored.
This is necessary to prevent features from interfering with the button mapping process. This includes accelerometers, as well as PS4 triggers which send both a button press and an analog value.
primitives | The driver primitives to be ignored |
Implements KODI::JOYSTICK::IButtonMap.