Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Button mapper interface to assign the driver's raw button/hat/axis elements to physical joystick features using a provided button map. More...
#include <IButtonMapper.h>
Public Member Functions | |
IButtonMapper ()=default | |
virtual | ~IButtonMapper ()=default |
virtual std::string | ControllerID (void) const =0 |
The add-on ID of the game controller associated with this button mapper. | |
virtual bool | NeedsCooldown (void) const =0 |
Return true if the button mapper wants a cooldown between button mapping commands. | |
virtual bool | AcceptsPrimitive (PRIMITIVE_TYPE type) const =0 |
Return true if the button mapper accepts primitives of the given type. | |
virtual bool | MapPrimitive (IButtonMap *buttonMap, KEYMAP::IKeymap *keyMap, const CDriverPrimitive &primitive)=0 |
Handle button/hat press or axis threshold. | |
virtual void | OnEventFrame (const IButtonMap *buttonMap, bool bMotion)=0 |
Called once per event frame to notify the implementation of motion status. | |
virtual void | OnLateAxis (const IButtonMap *buttonMap, unsigned int axisIndex)=0 |
Called when an axis has been detected after mapping began. | |
void | SetButtonMapCallback (const std::string &deviceLocation, IButtonMapCallback *callback) |
void | ResetButtonMapCallbacks (void) |
std::map< std::string, IButtonMapCallback * > & | ButtonMapCallbacks (void) |
Button mapper interface to assign the driver's raw button/hat/axis elements to physical joystick features using a provided button map.
|
default |
|
virtualdefault |
|
pure virtual |
Return true if the button mapper accepts primitives of the given type.
type | The primitive type |
Implemented in KODI::GAME::CGUIConfigurationWizard, KODI::GAME::CGUIDialogAxisDetection, and KODI::GAME::CGUIDialogIgnoreInput.
|
inline |
|
pure virtual |
The add-on ID of the game controller associated with this button mapper.
Implemented in KODI::GAME::CGUIConfigurationWizard, and KODI::GAME::CGUIDialogButtonCapture.
|
pure virtual |
Handle button/hat press or axis threshold.
buttonMap | The button map being manipulated |
keymap | An interface capable of translating features to Kodi actions |
primitive | The driver primitive |
Called in the same thread as IButtonMapper::OnFrame.
Implemented in KODI::GAME::CGUIConfigurationWizard, and KODI::GAME::CGUIDialogButtonCapture.
Return true if the button mapper wants a cooldown between button mapping commands.
Implemented in KODI::GAME::CGUIConfigurationWizard, and KODI::GAME::CGUIDialogButtonCapture.
|
pure virtual |
Called once per event frame to notify the implementation of motion status.
buttonMap | The button map passed to MapPrimitive() (shall not be modified) |
bMotion | True if a previously-mapped axis is still in motion |
This allows the implementer to wait for an axis to be centered before allowing it to be used as Kodi input.
If mapping finishes on an axis, then the axis will still be pressed and sending input every frame when the mapping ends. For example, when the right analog stick is the last feature to be mapped, it is still pressed when mapping ends and immediately sends Volume Down actions.
The fix is to allow implementers to wait until all axes are motionless before detaching themselves.
Called in the same thread as IButtonMapper::MapPrimitive.
Implemented in KODI::GAME::CGUIConfigurationWizard, and KODI::GAME::CGUIDialogButtonCapture.
|
pure virtual |
Called when an axis has been detected after mapping began.
axisIndex | The index of the axis being discovered |
Some joystick drivers don't report an initial value for analog axes.
Called in the same thread as IButtonMapper::MapPrimitive.
Implemented in KODI::GAME::CGUIConfigurationWizard, KODI::GAME::CGUIDialogAxisDetection, and KODI::GAME::CGUIDialogButtonCapture.
|
inline |