Main object for injecting key strokes based on joystick movements.
More...
#include <libmythui/devices/jsmenu.h>
|
| void | run () override |
| | This function is the heart of a thread which looks for Joystick input and translates it into key press events. More...
|
| |
| virtual void | run (void) |
| | Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead. More...
|
| |
| int | exec (void) |
| | Enters the qt event loop. call exit or quit to exit thread. More...
|
| |
Main object for injecting key strokes based on joystick movements.
Definition at line 90 of file jsmenu.h.
◆ JoystickMenuThread()
| JoystickMenuThread::JoystickMenuThread |
( |
QObject * |
main_window | ) |
|
|
inlineexplicit |
◆ ~JoystickMenuThread()
| JoystickMenuThread::~JoystickMenuThread |
( |
| ) |
|
|
override |
◆ AxisChange()
| void JoystickMenuThread::AxisChange |
( |
int |
axis, |
|
|
int |
value |
|
) |
| |
Handle a registered change in a joystick axis.
Definition at line 453 of file jsmenu.cpp.
Referenced by run().
◆ ButtonUp()
| void JoystickMenuThread::ButtonUp |
( |
int |
button | ) |
|
Handle a button up event.
This is mildly complicated by the support for 'chords'; holding down a button and pushing down another can create one type of event.
Definition at line 421 of file jsmenu.cpp.
Referenced by run().
◆ EmitKey()
| void JoystickMenuThread::EmitKey |
( |
const QString & |
code | ) |
|
◆ Init()
| bool JoystickMenuThread::Init |
( |
QString & |
config_file | ) |
|
Initialise the class variables with values from the config file.
Definition at line 79 of file jsmenu.cpp.
Referenced by run().
◆ ReadConfig()
| bool JoystickMenuThread::ReadConfig |
( |
const QString & |
config_file | ) |
|
Read from action to key mappings from flat file config file.
Config file has the following format:
Starts a comment
devicename devname - Name of physical joystick device button num keystring - Represents a button chord cnum bnum keystring - A chorded button sequence; hold down cnum and press bnum to generate a key axis num from to keystring - Represents an axis range to trigger a key move that axis into the range and the keystring is sent
Definition at line 158 of file jsmenu.cpp.
Referenced by Init().
◆ run()
| void JoystickMenuThread::run |
( |
void |
| ) |
|
|
overrideprotectedvirtual |
This function is the heart of a thread which looks for Joystick input and translates it into key press events.
Reimplemented from MThread.
Definition at line 224 of file jsmenu.cpp.
◆ Stop()
| void JoystickMenuThread::Stop |
( |
void |
| ) |
|
|
inline |
◆ m_axes
| int* JoystickMenuThread::m_axes {nullptr} |
|
private |
◆ m_axesCount
| unsigned char JoystickMenuThread::m_axesCount {0} |
|
private |
Track the status of the joystick axes as we do depend slightly on state.
Definition at line 128 of file jsmenu.h.
Referenced by Init(), and run().
◆ m_bStop
| volatile bool JoystickMenuThread::m_bStop {false} |
|
private |
◆ m_buttonCount
| unsigned char JoystickMenuThread::m_buttonCount {0} |
|
private |
Track the status of the joystick buttons as we do depend slightly on state.
Definition at line 122 of file jsmenu.h.
Referenced by Init(), and run().
◆ m_buttons
| int* JoystickMenuThread::m_buttons {nullptr} |
|
private |
◆ m_configFile
| QString JoystickMenuThread::m_configFile |
|
private |
◆ m_configRead
| bool JoystickMenuThread::m_configRead {false} |
|
private |
◆ m_devicename
| QString JoystickMenuThread::m_devicename |
|
private |
◆ m_fd
| int JoystickMenuThread::m_fd {-1} |
|
private |
◆ m_mainWindow
| QObject* JoystickMenuThread::m_mainWindow {nullptr} |
|
private |
◆ m_map
◆ m_readError
| bool JoystickMenuThread::m_readError {false} |
|
private |
The documentation for this class was generated from the following files: