|
MythTV
0.26-pre
|
Main object for injecting key strokes based on joystick movements. More...
#include <jsmenu.h>
Public Member Functions | |
| JoystickMenuThread (QObject *main_window) | |
| ~JoystickMenuThread () | |
| int | Init (QString &config_file) |
| Initialise the class variables with values from the config file. | |
| void | ButtonUp (int button) |
| Handle a button up event. | |
| void | AxisChange (int axis, int value) |
| Handle a registered change in a joystick axis. | |
| void | EmitKey (QString code) |
| Send a keyevent to the main UI loop with the appropriate keycode. | |
| int | ReadConfig (QString config_file) |
| Read from action to key mappings from flat file config file. | |
| void | Stop (void) |
Private Member Functions | |
| void | run (void) |
| This function is the heart of a thread which looks for Joystick input and translates it into key press events. | |
Private Attributes | |
| QObject * | m_mainWindow |
| QString | m_devicename |
| int | m_fd |
| JoystickMap | m_map |
| unsigned char | m_buttonCount |
| Track the status of the joystick buttons as we do depend slightly on state. | |
| unsigned char | m_axesCount |
| Track the status of the joystick axes as we do depend slightly on state. | |
| int * | m_buttons |
| int * | m_axes |
| volatile bool | m_bStop |
Main object for injecting key strokes based on joystick movements.
| JoystickMenuThread::JoystickMenuThread | ( | QObject * | main_window | ) |
Definition at line 53 of file jsmenu.cpp.
Definition at line 62 of file jsmenu.cpp.
| int JoystickMenuThread::Init | ( | QString & | config_file | ) |
Initialise the class variables with values from the config file.
Definition at line 80 of file jsmenu.cpp.
Referenced by MythMainWindow::MythMainWindow().
| 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 327 of file jsmenu.cpp.
Referenced by run().
| void JoystickMenuThread::AxisChange | ( | int | axis, |
| int | value | ||
| ) |
Handle a registered change in a joystick axis.
Definition at line 359 of file jsmenu.cpp.
Referenced by run().
| void JoystickMenuThread::EmitKey | ( | QString | code | ) |
Send a keyevent to the main UI loop with the appropriate keycode.
Definition at line 296 of file jsmenu.cpp.
Referenced by AxisChange(), and ButtonUp().
| int JoystickMenuThread::ReadConfig | ( | 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 151 of file jsmenu.cpp.
Referenced by Init().
| void JoystickMenuThread::Stop | ( | void | ) | [inline] |
Definition at line 92 of file jsmenu.h.
Referenced by MythMainWindow::~MythMainWindow().
| void JoystickMenuThread::run | ( | void | ) | [private, virtual] |
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 197 of file jsmenu.cpp.
QObject* JoystickMenuThread::m_mainWindow [private] |
QString JoystickMenuThread::m_devicename [private] |
Definition at line 98 of file jsmenu.h.
Referenced by Init(), and ReadConfig().
int JoystickMenuThread::m_fd [private] |
Definition at line 99 of file jsmenu.h.
Referenced by Init(), run(), and ~JoystickMenuThread().
JoystickMap JoystickMenuThread::m_map [private] |
Definition at line 100 of file jsmenu.h.
Referenced by AxisChange(), ButtonUp(), and ReadConfig().
unsigned char JoystickMenuThread::m_buttonCount [private] |
unsigned char JoystickMenuThread::m_axesCount [private] |
int* JoystickMenuThread::m_buttons [private] |
Definition at line 114 of file jsmenu.h.
Referenced by ButtonUp(), Init(), run(), and ~JoystickMenuThread().
int* JoystickMenuThread::m_axes [private] |
Definition at line 115 of file jsmenu.h.
Referenced by AxisChange(), Init(), run(), and ~JoystickMenuThread().
volatile bool JoystickMenuThread::m_bStop [private] |
1.7.6.1