AntiMicroX
Loading...
Searching...
No Matches
src
joysensorpushbutton.h
Go to the documentation of this file.
1
/* antimicrox Gamepad to KB+M event mapper
2
* Copyright (C) 2022 Max Maisel <max.maisel@posteo.de>
3
*
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 3 of the License, or
7
* (at your option) any later version.
8
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
#pragma once
18
19
#include "
flashbuttonwidget.h
"
20
21
class
JoySensor
;
22
class
QWidget;
23
27
class
JoySensorPushButton
:
public
FlashButtonWidget
28
{
29
Q_OBJECT
30
31
public
:
32
explicit
JoySensorPushButton
(
JoySensor
*
sensor
,
bool
displayNames, QWidget *
parent
=
nullptr
);
33
34
JoySensor
*
getSensor
()
const
;
35
void
tryFlash
();
36
37
protected
:
38
virtual
QString
generateLabel
()
override
;
39
40
public
slots
:
41
void
disableFlashes
()
override
;
42
void
enableFlashes
()
override
;
43
44
private
slots
:
45
void
showContextMenu
(
const
QPoint
&
point
);
46
47
private
:
48
JoySensor
*
m_sensor
;
49
};
FlashButtonWidget
Definition
flashbuttonwidget.h:28
JoyDPadXml
Definition
joydpadxml.h:27
JoySensorPushButton
The central button in a SensorPushButtonGroup.
Definition
joysensorpushbutton.h:28
JoySensorPushButton::getSensor
JoySensor * getSensor() const
Get the underlying JoySensor object.
Definition
joysensorpushbutton.cpp:44
JoySensorPushButton::disableFlashes
void disableFlashes() override
Disables highlight when the sensor axis is moved.
Definition
joysensorpushbutton.cpp:66
JoySensorPushButton::generateLabel
virtual QString generateLabel() override
Generate the string that will be displayed on the button.
Definition
joysensorpushbutton.cpp:50
JoySensorPushButton::enableFlashes
void enableFlashes() override
Enables highlight when the sensor axis is moved.
Definition
joysensorpushbutton.cpp:76
JoySensorPushButton::tryFlash
void tryFlash()
Highlights the button when sensor is not centered.
Definition
joysensorpushbutton.cpp:96
JoySensorPushButton::showContextMenu
void showContextMenu(const QPoint &point)
Shows sensor context menu.
Definition
joysensorpushbutton.cpp:85
JoySensorPushButton::m_sensor
JoySensor * m_sensor
Definition
joysensorpushbutton.h:48
JoySensor
Represents one sensor in a SetJoystick and its connections to other parts of the application....
Definition
joysensor.h:40
flashbuttonwidget.h
Generated by
1.9.8