Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Button map interface to translate between the driver's raw button/hat/axis elements and physical joystick features. More...
#include <IButtonMap.h>
Public Member Functions | |
virtual | ~IButtonMap ()=default |
virtual std::string | ControllerID (void) const =0 |
The add-on ID of the game controller associated with this button map. | |
virtual std::string | Location (void) const =0 |
The Location of the peripheral associated with this button map. | |
virtual bool | Load (void)=0 |
Load the button map into memory. | |
virtual void | Reset (void)=0 |
Reset the button map to its defaults, or clear button map if no defaults. | |
virtual bool | IsEmpty (void) const =0 |
Check if the button map is empty. | |
virtual std::string | GetAppearance () const =0 |
Get the ID of the controller profile that best represents the appearance of the peripheral. | |
virtual bool | SetAppearance (const std::string &controllerId) const =0 |
Set the ID of the controller that best represents the appearance of the peripheral. | |
virtual bool | GetFeature (const CDriverPrimitive &primitive, FeatureName &feature)=0 |
Get the feature associated with a driver primitive. | |
virtual FEATURE_TYPE | GetFeatureType (const FeatureName &feature)=0 |
Get the type of the feature for the given name. | |
virtual bool | GetScalar (const FeatureName &feature, CDriverPrimitive &primitive)=0 |
Get the driver primitive for a scalar feature. | |
virtual void | AddScalar (const FeatureName &feature, const CDriverPrimitive &primitive)=0 |
Add or update a scalar feature. | |
virtual bool | GetAnalogStick (const FeatureName &feature, ANALOG_STICK_DIRECTION direction, CDriverPrimitive &primitive)=0 |
Get an analog stick direction from the button map. | |
virtual void | AddAnalogStick (const FeatureName &feature, ANALOG_STICK_DIRECTION direction, const CDriverPrimitive &primitive)=0 |
Add or update an analog stick direction. | |
virtual bool | GetRelativePointer (const FeatureName &feature, RELATIVE_POINTER_DIRECTION direction, CDriverPrimitive &primitive)=0 |
Get a relative pointer direction from the button map. | |
virtual void | AddRelativePointer (const FeatureName &feature, RELATIVE_POINTER_DIRECTION direction, const CDriverPrimitive &primitive)=0 |
Add or update a relative pointer direction. | |
virtual bool | GetAccelerometer (const FeatureName &feature, CDriverPrimitive &positiveX, CDriverPrimitive &positiveY, CDriverPrimitive &positiveZ)=0 |
Get an accelerometer from the button map. | |
virtual void | AddAccelerometer (const FeatureName &feature, const CDriverPrimitive &positiveX, const CDriverPrimitive &positiveY, const CDriverPrimitive &positiveZ)=0 |
Get or update an accelerometer. | |
virtual bool | GetWheel (const FeatureName &feature, WHEEL_DIRECTION direction, CDriverPrimitive &primitive)=0 |
Get a wheel direction from the button map. | |
virtual void | AddWheel (const FeatureName &feature, WHEEL_DIRECTION direction, const CDriverPrimitive &primitive)=0 |
Add or update a wheel direction. | |
virtual bool | GetThrottle (const FeatureName &feature, THROTTLE_DIRECTION direction, CDriverPrimitive &primitive)=0 |
Get a throttle direction from the button map. | |
virtual void | AddThrottle (const FeatureName &feature, THROTTLE_DIRECTION direction, const CDriverPrimitive &primitive)=0 |
Add or update a throttle direction. | |
virtual bool | GetKey (const FeatureName &feature, CDriverPrimitive &primitive)=0 |
Get the driver primitive for a keyboard key. | |
virtual void | AddKey (const FeatureName &feature, const CDriverPrimitive &primitive)=0 |
Add or update a key. | |
virtual void | SetIgnoredPrimitives (const std::vector< CDriverPrimitive > &primitives)=0 |
Set a list of driver primitives to be ignored. | |
virtual bool | IsIgnored (const CDriverPrimitive &primitive)=0 |
Check if a primitive is in the list of primitives to be ignored. | |
virtual bool | GetAxisProperties (unsigned int axisIndex, int ¢er, unsigned int &range)=0 |
Get the properties of an axis. | |
virtual void | SaveButtonMap ()=0 |
Save the button map. | |
virtual void | RevertButtonMap ()=0 |
Revert changes to the button map since the last time it was loaded or committed to disk. | |
Button map interface to translate between the driver's raw button/hat/axis elements and physical joystick features.
|
virtualdefault |
|
pure virtual |
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.
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
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 |
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
Add or update a key.
feature | Must be a key |
primitive | The feature's driver primitive |
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
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 |
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
Add or update a scalar feature.
feature | Must be a scalar feature |
primitive | The feature's driver primitive |
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
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 |
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
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 |
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
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.
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
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) |
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
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 |
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
Get the ID of the controller profile that best represents the appearance of the peripheral.
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
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 |
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
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 |
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
Get the type of the feature for the given name.
feature | The feature to look up |
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
Get the driver primitive for a keyboard key.
feature | Must be a key |
primitive | The resolved driver primitive |
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
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 |
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
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 |
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
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 |
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
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 |
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
Check if the button map is empty.
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
Check if a primitive is in the list of primitives to be ignored.
primitive | The primitive to check |
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
Load the button map into memory.
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
The Location of the peripheral associated with this button map.
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
Reset the button map to its defaults, or clear button map if no defaults.
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
Revert changes to the button map since the last time it was loaded or committed to disk.
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
Save the button map.
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
Set the ID of the controller that best represents the appearance of the peripheral.
controllerId | The controller ID, or empty to unset the appearance |
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.
|
pure virtual |
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 |
Implemented in KODI::GAME::CDefaultButtonMap, and PERIPHERALS::CAddonButtonMap.