MythTV  master
Public Types | Public Member Functions | Public Attributes | List of all members
JoystickMap Class Reference

Holds the buttonMapType and axisMapType structs which map actions to events. More...

#include <libmythui/devices/jsmenu.h>

Collaboration diagram for JoystickMap:
[legend]

Public Types

using button_map_t = std::vector< buttonMapType >
 
using axis_map_t = std::vector< axisMapType >
 

Public Member Functions

void AddButton (int in_button, QString in_keystr, int in_chord=-1)
 
void AddAxis (int in_axis, int in_from, int in_to, QString in_keystr)
 
void Clear ()
 
const button_map_tbuttonMap () const
 
const axis_map_taxisMap () const
 

Public Attributes

button_map_t m_buttonMap
 
axis_map_t m_axisMap
 

Detailed Description

Holds the buttonMapType and axisMapType structs which map actions to events.

We build a map of how joystick buttons and axes (axes are for sticks and thumb controllers) are mapped into keystrokes. For buttons, it's mostly very simple: joystick button number corresponds to a key sequence that is sent to MythTV. We complicate it a little by allowing for 'chords', which means that if you hold down the 'chord' button while pressing the other button, we use the alternate mapping For axes, it's not very complicated. For each axis (ie up/down or left/right), we define a range; the first time the joystick moves into that range, we send the assigned keystring.

Definition at line 51 of file jsmenu.h.

Member Typedef Documentation

◆ button_map_t

Definition at line 71 of file jsmenu.h.

◆ axis_map_t

using JoystickMap::axis_map_t = std::vector<axisMapType>

Definition at line 72 of file jsmenu.h.

Member Function Documentation

◆ AddButton()

void JoystickMap::AddButton ( int  in_button,
QString  in_keystr,
int  in_chord = -1 
)
inline

Definition at line 54 of file jsmenu.h.

Referenced by JoystickMenuThread::ReadConfig().

◆ AddAxis()

void JoystickMap::AddAxis ( int  in_axis,
int  in_from,
int  in_to,
QString  in_keystr 
)
inline

Definition at line 60 of file jsmenu.h.

Referenced by JoystickMenuThread::ReadConfig().

◆ Clear()

void JoystickMap::Clear ( )
inline

Definition at line 66 of file jsmenu.h.

Referenced by JoystickMenuThread::ReadConfig().

◆ buttonMap()

const button_map_t& JoystickMap::buttonMap ( ) const
inline

Definition at line 73 of file jsmenu.h.

Referenced by JoystickMenuThread::ButtonUp().

◆ axisMap()

const axis_map_t& JoystickMap::axisMap ( ) const
inline

Definition at line 74 of file jsmenu.h.

Referenced by JoystickMenuThread::AxisChange().

Member Data Documentation

◆ m_buttonMap

button_map_t JoystickMap::m_buttonMap

Definition at line 76 of file jsmenu.h.

Referenced by AddButton(), buttonMap(), and Clear().

◆ m_axisMap

axis_map_t JoystickMap::m_axisMap

Definition at line 77 of file jsmenu.h.

Referenced by AddAxis(), axisMap(), and Clear().


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