AntiMicroX
joystickstatuswindow.h
Go to the documentation of this file.
1 /* antimicrox Gamepad to KB+M event mapper
2  * Copyright (C) 2015 Travis Nickles <nickles.travis@gmail.com>
3  * Copyright (C) 2020 Jagoda Górska <juliagoda.pl@protonmail>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9 
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14 
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef JOYSTICKSTATUSWINDOW_H
20 #define JOYSTICKSTATUSWINDOW_H
21 
22 #include <QDialog>
23 
24 class InputDevice;
25 class QProgressBar;
26 class QWidget;
27 
28 namespace Ui {
30 }
31 
36 class JoystickStatusWindow : public QDialog
37 {
38  Q_OBJECT
39 
40  public:
41  explicit JoystickStatusWindow(InputDevice *joystick, QWidget *parent = nullptr);
43 
44  InputDevice *getJoystick() const;
45 
46  private:
47  Ui::JoystickStatusWindow *ui;
48 
50  QProgressBar *m_accel_axes[3];
51  QProgressBar *m_gyro_axes[3];
52 
53  private slots:
54  void restoreButtonStates(int code);
55  void obliterate();
56  void updateAccelerometerValues(float valueX, float valueY, float valueZ);
57  void updateGyroscopeValues(float valueX, float valueY, float valueZ);
58 };
59 
60 #endif // JOYSTICKSTATUSWINDOW_H
InputDevice::isGameController
virtual bool isGameController()
Check if device is using the SDL Game Controller API.
Definition: inputdevice.cpp:1341
JoystickStatusWindow::updateGyroscopeValues
void updateGyroscopeValues(float valueX, float valueY, float valueZ)
Gyroscope "moved" event handler Updates raw gyroscope values on the screen.
Definition: joystickstatuswindow.cpp:337
JoyDPad::released
void released(int value)
JoySensor::moved
void moved(float xaxis, float yaxis, float zaxis)
joybuttonstatusbox.h
JoyDPadButton::DpadLeftDown
@ DpadLeftDown
Definition: joydpadbutton.h:51
joystickstatuswindow.h
code
the intent is to exercise the right to control the distribution of derivative or collective works based on the Library In mere aggregation of another work not based on the Library with the you must alter all the notices that refer to this so that they refer to the ordinary GNU General Public instead of to this it is irreversible for that so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy This option is useful when you wish to copy part of the code of the Library into a program that is not a library You may copy and distribute the which must be distributed under the terms of Sections and above on a medium customarily used for software interchange If distribution of object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code
Definition: lgpl-2.1.txt:237
JoySensor::getZCoordinate
virtual float getZCoordinate() const =0
SetJoystick::getSensor
JoySensor * getSensor(JoySensorType type) const
Definition: setjoystick.cpp:71
JoystickStatusWindow::m_accel_axes
QProgressBar * m_accel_axes[3]
Definition: joystickstatuswindow.h:50
JoyDPad::getCurrentDirection
int getCurrentDirection()
Definition: joydpad.cpp:202
JoyAxis
Represents single axis of of joystick (or other input)
Definition: joyaxis.h:40
JoyAxis::getRealJoyIndex
int getRealJoyIndex()
Definition: joyaxis.cpp:251
SetJoystick::setIgnoreEventState
void setIgnoreEventState(bool ignore)
Definition: setjoystick.cpp:756
JoystickStatusWindow::joystick
InputDevice * joystick
Definition: joystickstatuswindow.h:49
globalvariables.h
InputDevice::getNumberAxes
virtual int getNumberAxes()
Definition: inputdevice.cpp:567
joysensor.h
InputDevice
Abstract class representing a hardware input device, e.g a joystick or controller.
Definition: inputdevice.h:50
JoystickStatusWindow::JoystickStatusWindow
JoystickStatusWindow(InputDevice *joystick, QWidget *parent=nullptr)
Definition: joystickstatuswindow.cpp:39
JoystickStatusWindow
The joystick "Properties" window. Shows various raw values to the user.
Definition: joystickstatuswindow.h:36
JoySensor::sensorTypeName
virtual QString sensorTypeName() const =0
InputDevice::getNumberRawAxes
virtual int getNumberRawAxes()=0
JoystickStatusWindow::ui
Ui::JoystickStatusWindow * ui
Definition: joystickstatuswindow.h:47
JoySensorType
JoySensorType
Definition: joysensortype.h:23
InputDevice::getRealJoyNumber
int getRealJoyNumber()
Definition: inputdevice.cpp:60
InputDevice::getJoyHandle
SDL_Joystick * getJoyHandle() const
Definition: inputdevice.cpp:1727
JoySensor::radToDeg
static double radToDeg(double value)
Utility function which converts a given value from radians to degree.
Definition: joysensor.cpp:519
InputDevice::getSDLName
virtual QString getSDLName()=0
Ui
Definition: aboutdialog.h:26
joydpadbutton.h
JoyButtonStatusBox
Definition: joybuttonstatusbox.h:27
GlobalVariables::JoySensor::GYRO_MIN
static const double GYRO_MIN
Definition: globalvariables.h:231
InputDevice::getNumberRawButtons
virtual int getNumberRawButtons()=0
InputDevice::hasRawSensor
virtual bool hasRawSensor(JoySensorType type)=0
JoyDPad
Definition: joydpad.h:24
JoystickStatusWindow::m_gyro_axes
QProgressBar * m_gyro_axes[3]
Definition: joystickstatuswindow.h:51
JoyAxis::moved
void moved(int value)
SetJoystick::getJoyButton
JoyButton * getJoyButton(int index) const
Definition: setjoystick.cpp:57
JoystickStatusWindow::obliterate
void obliterate()
Definition: joystickstatuswindow.cpp:320
inputdevice.h
JoystickStatusWindow::getJoystick
InputDevice * getJoystick() const
Definition: joystickstatuswindow.cpp:344
GlobalVariables::JoyAxis::AXISMIN
static const int AXISMIN
Definition: globalvariables.h:117
GlobalVariables::JoyAxis::AXISMAX
static const int AXISMAX
Definition: globalvariables.h:118
InputDevice::getNumberButtons
virtual int getNumberButtons()
Definition: inputdevice.cpp:565
JoyButton
Represents a single joystick button being part of a SetJoystick Contains multiple JoyButtonSlots whic...
Definition: joybutton.h:46
SetJoystick::release
void release()
Perform a release of all elements of a set. Stick and vdpad releases will be handled by the associate...
Definition: setjoystick.cpp:319
SetJoystick::getJoyDPad
JoyDPad * getJoyDPad(int index) const
Definition: setjoystick.cpp:65
common.h
JoystickStatusWindow::~JoystickStatusWindow
~JoystickStatusWindow()
Definition: joystickstatuswindow.cpp:305
JoystickStatusWindow::restoreButtonStates
void restoreButtonStates(int code)
Definition: joystickstatuswindow.cpp:307
GlobalVariables::JoySensor::GYRO_MAX
static const double GYRO_MAX
Definition: globalvariables.h:232
GlobalVariables::JoySensor::ACCEL_MAX
static const double ACCEL_MAX
Definition: globalvariables.h:230
SetJoystick::getJoyAxis
JoyAxis * getJoyAxis(int index) const
Definition: setjoystick.cpp:59
JoystickStatusWindow::updateAccelerometerValues
void updateAccelerometerValues(float valueX, float valueY, float valueZ)
Accelerometer "moved" event handler Updates raw accelerometer values on the screen.
Definition: joystickstatuswindow.cpp:326
JoySensor::getXCoordinate
virtual float getXCoordinate() const =0
JoySensor
Represents one sensor in a SetJoystick and its connections to other parts of the application....
Definition: joysensor.h:39
WARN
#define WARN()
Definition: logger.h:44
InputDevice::getNumberHats
virtual int getNumberHats()
Definition: inputdevice.cpp:569
GlobalVariables::JoySensor::ACCEL_MIN
static const double ACCEL_MIN
Definition: globalvariables.h:229
GYROSCOPE
@ GYROSCOPE
Definition: joysensortype.h:26
JoyDPad::getRealJoyNumber
int getRealJoyNumber()
Definition: joydpad.cpp:111
SENSOR_COUNT
@ SENSOR_COUNT
Definition: joysensortype.h:30
joydpad.h
number
it is up to the author donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License If the distribution and or use of the Library is restricted in certain countries either by patents or by copyrighted the original copyright holder who places the Library under this License may add an geographical distribution limitation excluding those so that distribution is permitted only in or among countries not thus excluded In such this License incorporates the limitation as if written in the body of this License The Free Software Foundation may publish revised and or new versions of the Lesser General Public License from time to time Such new versions will be similar in spirit to the present but may differ in detail to address new problems or concerns Each version is given a distinguishing version number If the Library specifies a version number of this License which applies to it and any later you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation If the Library does not specify a license version number
Definition: lgpl-2.1.txt:423
PadderCommon::inputDaemonMutex
QMutex inputDaemonMutex
Definition: common.cpp:223
InputDevice::getUniqueIDString
virtual QString getUniqueIDString() const =0
InputDevice::getNumberRawHats
virtual int getNumberRawHats()=0
JoySensor::getYCoordinate
virtual float getYCoordinate() const =0
JoyDPadButton::DpadCentered
@ DpadCentered
Definition: joydpadbutton.h:43
ACCELEROMETER
@ ACCELEROMETER
Definition: joysensortype.h:25
InputDevice::resetButtonDownCount
void resetButtonDownCount()
Definition: inputdevice.cpp:1123
JoyDPad::active
void active(int value)
InputDevice::getActiveSetJoystick
SetJoystick * getActiveSetJoystick()
Definition: inputdevice.cpp:563
JoyAxis::getCurrentRawValue
int getCurrentRawValue()
Definition: joyaxis.cpp:463