Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
PERIPHERALS::CAndroidJoystickState Class Reference

#include <AndroidJoystickState.h>

Public Member Functions

 CAndroidJoystickState ()=default
 
 CAndroidJoystickState (CAndroidJoystickState &&other) noexcept
 
virtual ~CAndroidJoystickState ()
 
int GetDeviceId () const
 
unsigned int GetButtonCount () const
 
unsigned int GetAxisCount () const
 
bool Initialize (const CJNIViewInputDevice &inputDevice)
 Initialize the joystick object.
 
bool InitializeButtonMap (KODI::JOYSTICK::IButtonMap &buttonMap) const
 Initialize a joystick buttonmap, if possible.
 
void Deinitialize ()
 Deinitialize the joystick object.
 
bool ProcessEvent (const AInputEvent *event)
 Processes the given input event.
 
void GetEvents (std::vector< kodi::addon::PeripheralEvent > &events)
 Get events that have occurred since the last call to GetEvents()
 

Constructor & Destructor Documentation

◆ CAndroidJoystickState() [1/2]

PERIPHERALS::CAndroidJoystickState::CAndroidJoystickState ( )
default

◆ CAndroidJoystickState() [2/2]

CAndroidJoystickState::CAndroidJoystickState ( CAndroidJoystickState && other)
noexcept

◆ ~CAndroidJoystickState()

CAndroidJoystickState::~CAndroidJoystickState ( )
virtual

Member Function Documentation

◆ Deinitialize()

void CAndroidJoystickState::Deinitialize ( void )

Deinitialize the joystick object.

GetEvents() will not be called after deinitialization.

◆ GetAxisCount()

unsigned int PERIPHERALS::CAndroidJoystickState::GetAxisCount ( ) const
inline

◆ GetButtonCount()

unsigned int PERIPHERALS::CAndroidJoystickState::GetButtonCount ( ) const
inline

◆ GetDeviceId()

int PERIPHERALS::CAndroidJoystickState::GetDeviceId ( ) const
inline

◆ GetEvents()

void CAndroidJoystickState::GetEvents ( std::vector< kodi::addon::PeripheralEvent > & events)

Get events that have occurred since the last call to GetEvents()

◆ Initialize()

bool CAndroidJoystickState::Initialize ( const CJNIViewInputDevice & inputDevice)

Initialize the joystick object.

Joystick will be initialized before the first call to GetEvents().

◆ InitializeButtonMap()

bool CAndroidJoystickState::InitializeButtonMap ( KODI::JOYSTICK::IButtonMap & buttonMap) const

Initialize a joystick buttonmap, if possible.

Android has a large database of buttonmaps, which it uses to provide mapped button keycodes such as AKEYCODE_BUTTON_A. We can take advantage of this to initialize a default buttonmap based on these mappings.

If Android can't map the buttons, it will use generic button keycodes such as AKEYCODE_BUTTON_1, in which case we can't initialize the buttonmap.

◆ ProcessEvent()

bool CAndroidJoystickState::ProcessEvent ( const AInputEvent * event)

Processes the given input event.


The documentation for this class was generated from the following files: