AntiMicroX
Loading...
Searching...
No Matches
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
21class JoySensor;
22class QWidget;
23
28{
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:
49};
Definition flashbuttonwidget.h:28
Definition joydpadxml.h:27
The central button in a SensorPushButtonGroup.
Definition joysensorpushbutton.h:28
JoySensor * getSensor() const
Get the underlying JoySensor object.
Definition joysensorpushbutton.cpp:44
void disableFlashes() override
Disables highlight when the sensor axis is moved.
Definition joysensorpushbutton.cpp:66
virtual QString generateLabel() override
Generate the string that will be displayed on the button.
Definition joysensorpushbutton.cpp:50
void enableFlashes() override
Enables highlight when the sensor axis is moved.
Definition joysensorpushbutton.cpp:76
void tryFlash()
Highlights the button when sensor is not centered.
Definition joysensorpushbutton.cpp:96
void showContextMenu(const QPoint &point)
Shows sensor context menu.
Definition joysensorpushbutton.cpp:85
JoySensor * m_sensor
Definition joysensorpushbutton.h:48
Represents one sensor in a SetJoystick and its connections to other parts of the application....
Definition joysensor.h:40