Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
A fallback buttonmap to be used with the default keyboard profile. More...
#include <DefaultButtonMap.h>
Public Member Functions | |
CDefaultButtonMap (PERIPHERALS::CPeripheral *device, std::string strControllerId) | |
~CDefaultButtonMap () override | |
std::string | ControllerID () const override |
The add-on ID of the game controller associated with this button map. | |
std::string | Location () const override |
The Location of the peripheral associated with this button map. | |
bool | Load () override |
Load the button map into memory. | |
void | Reset () override |
Reset the button map to its defaults, or clear button map if no defaults. | |
bool | IsEmpty () 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 JOYSTICK::CDriverPrimitive &primitive, JOYSTICK::FeatureName &feature) override |
Get the feature associated with a driver primitive. | |
JOYSTICK::FEATURE_TYPE | GetFeatureType (const JOYSTICK::FeatureName &feature) override |
Get the type of the feature for the given name. | |
bool | GetScalar (const JOYSTICK::FeatureName &feature, JOYSTICK::CDriverPrimitive &primitive) override |
Get the driver primitive for a scalar feature. | |
void | AddScalar (const JOYSTICK::FeatureName &feature, const JOYSTICK::CDriverPrimitive &primitive) override |
Add or update a scalar feature. | |
bool | GetAnalogStick (const JOYSTICK::FeatureName &feature, JOYSTICK::ANALOG_STICK_DIRECTION direction, JOYSTICK::CDriverPrimitive &primitive) override |
Get an analog stick direction from the button map. | |
void | AddAnalogStick (const JOYSTICK::FeatureName &feature, JOYSTICK::ANALOG_STICK_DIRECTION direction, const JOYSTICK::CDriverPrimitive &primitive) override |
Add or update an analog stick direction. | |
bool | GetRelativePointer (const JOYSTICK::FeatureName &feature, JOYSTICK::RELATIVE_POINTER_DIRECTION direction, JOYSTICK::CDriverPrimitive &primitive) override |
Get a relative pointer direction from the button map. | |
void | AddRelativePointer (const JOYSTICK::FeatureName &feature, JOYSTICK::RELATIVE_POINTER_DIRECTION direction, const JOYSTICK::CDriverPrimitive &primitive) override |
Add or update a relative pointer direction. | |
bool | GetAccelerometer (const JOYSTICK::FeatureName &feature, JOYSTICK::CDriverPrimitive &positiveX, JOYSTICK::CDriverPrimitive &positiveY, JOYSTICK::CDriverPrimitive &positiveZ) override |
Get an accelerometer from the button map. | |
void | AddAccelerometer (const JOYSTICK::FeatureName &feature, const JOYSTICK::CDriverPrimitive &positiveX, const JOYSTICK::CDriverPrimitive &positiveY, const JOYSTICK::CDriverPrimitive &positiveZ) override |
Get or update an accelerometer. | |
bool | GetWheel (const JOYSTICK::FeatureName &feature, JOYSTICK::WHEEL_DIRECTION direction, JOYSTICK::CDriverPrimitive &primitive) override |
Get a wheel direction from the button map. | |
void | AddWheel (const JOYSTICK::FeatureName &feature, JOYSTICK::WHEEL_DIRECTION direction, const JOYSTICK::CDriverPrimitive &primitive) override |
Add or update a wheel direction. | |
bool | GetThrottle (const JOYSTICK::FeatureName &feature, JOYSTICK::THROTTLE_DIRECTION direction, JOYSTICK::CDriverPrimitive &primitive) override |
Get a throttle direction from the button map. | |
void | AddThrottle (const JOYSTICK::FeatureName &feature, JOYSTICK::THROTTLE_DIRECTION direction, const JOYSTICK::CDriverPrimitive &primitive) override |
Add or update a throttle direction. | |
bool | GetKey (const JOYSTICK::FeatureName &feature, JOYSTICK::CDriverPrimitive &primitive) override |
Get the driver primitive for a keyboard key. | |
void | AddKey (const JOYSTICK::FeatureName &feature, const JOYSTICK::CDriverPrimitive &primitive) override |
Add or update a key. | |
void | SetIgnoredPrimitives (const std::vector< JOYSTICK::CDriverPrimitive > &primitives) override |
Set a list of driver primitives to be ignored. | |
bool | IsIgnored (const 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 |
A fallback buttonmap to be used with the default keyboard profile.
CDefaultButtonMap::CDefaultButtonMap | ( | PERIPHERALS::CPeripheral * | device, |
std::string | strControllerId ) |
|
overridedefault |
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
Add or update a key.
feature | Must be a key |
primitive | The feature's driver primitive |
Implements KODI::JOYSTICK::IButtonMap.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
Add or update a scalar feature.
feature | Must be a scalar feature |
primitive | The feature's driver primitive |
Implements KODI::JOYSTICK::IButtonMap.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
Get the type of the feature for the given name.
feature | The feature to look up |
Implements KODI::JOYSTICK::IButtonMap.
|
inlineoverridevirtual |
Get the driver primitive for a keyboard key.
feature | Must be a key |
primitive | The resolved driver primitive |
Implements KODI::JOYSTICK::IButtonMap.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
Check if the button map is empty.
Implements KODI::JOYSTICK::IButtonMap.
|
inlineoverridevirtual |
Check if a primitive is in the list of primitives to be ignored.
primitive | The primitive to check |
Implements KODI::JOYSTICK::IButtonMap.
|
overridevirtual |
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.
|
inlineoverridevirtual |
Reset the button map to its defaults, or clear button map if no defaults.
Implements KODI::JOYSTICK::IButtonMap.
|
inlineoverridevirtual |
Revert changes to the button map since the last time it was loaded or committed to disk.
Implements KODI::JOYSTICK::IButtonMap.
|
inlineoverridevirtual |
Save the button map.
Implements KODI::JOYSTICK::IButtonMap.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
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.