AntiMicroX
Loading...
Searching...
No Matches
axisvaluebox.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 AXISVALUEBOX_H
20#define AXISVALUEBOX_H
21
22#include <QWidget>
23
24class QResizeEvent;
25class QPaintEvent;
26class JoyAxis;
27
28class AxisValueBox : public QWidget
29{
30 Q_OBJECT
31 public:
32 explicit AxisValueBox(QWidget *parent = nullptr);
33
34 int getDeadZone();
35 int getMaxZone();
36 int getJoyValue();
37 int getThrottle();
38 int getMinAxValue();
39 int getMaxAxValue();
40
41 protected:
42 virtual void resizeEvent(QResizeEvent *event);
43 virtual void paintEvent(QPaintEvent *event);
44
45 public slots:
46 void setThrottle(int throttle);
47 void setValue(int value);
48 void setValue(JoyAxis *axis, int value);
49 void setDeadZone(int deadZone);
50 void setDeadZone(JoyAxis *axis, int deadZone);
51 void setMaxZone(int maxZone);
52 void setMaxZone(JoyAxis *axis, int deadZone);
53
54 private:
68};
69
70#endif // AXISVALUEBOX_H
Definition axisvaluebox.h:29
int getMaxZone()
Definition axisvaluebox.cpp:187
int m_maxZone
Definition axisvaluebox.h:57
int singleend
Definition axisvaluebox.h:67
void setThrottle(int throttle)
Definition axisvaluebox.cpp:49
int boxwidth
Definition axisvaluebox.h:60
int getMinAxValue()
Definition axisvaluebox.cpp:290
int singlewidth
Definition axisvaluebox.h:66
void setValue(int value)
Definition axisvaluebox.cpp:65
JoyAxis * m_axis
Definition axisvaluebox.h:55
int boxheight
Definition axisvaluebox.h:61
int lboxstart
Definition axisvaluebox.h:62
int rboxend
Definition axisvaluebox.h:65
int m_throttle
Definition axisvaluebox.h:59
void setMaxZone(int maxZone)
Definition axisvaluebox.cpp:165
void setDeadZone(int deadZone)
Definition axisvaluebox.cpp:141
virtual void paintEvent(QPaintEvent *event)
Definition axisvaluebox.cpp:210
int joyValue
Definition axisvaluebox.h:58
int getJoyValue()
Definition axisvaluebox.cpp:189
virtual void resizeEvent(QResizeEvent *event)
Definition axisvaluebox.cpp:193
int lboxend
Definition axisvaluebox.h:63
int m_deadZone
Definition axisvaluebox.h:56
int getThrottle()
Definition axisvaluebox.cpp:191
int getDeadZone()
Definition axisvaluebox.cpp:163
int rboxstart
Definition axisvaluebox.h:64
int getMaxAxValue()
Definition axisvaluebox.cpp:288
Represents single axis of of joystick (or other input)
Definition joyaxis.h:41