AntiMicroX
Loading...
Searching...
No Matches
joysensorbuttonpushbutton.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 JoySensorButton;
22class QWidget;
23
28{
31
32 public:
33 explicit JoySensorButtonPushButton(JoySensorButton *button, bool displayNames, QWidget *parent = nullptr);
34
36 void tryFlash();
37
38 protected:
39 virtual QString generateLabel() override;
40
41 public slots:
42 void disableFlashes() override;
43 void enableFlashes() override;
44
45 private slots:
46 void showContextMenu(const QPoint &point);
47
48 private:
50};
Definition flashbuttonwidget.h:28
bool isButtonFlashing()
Definition flashbuttonwidget.cpp:68
Definition joydpadxml.h:27
A direction button in the SensorPushButtonGroup.
Definition joysensorbuttonpushbutton.h:28
JoySensorButton * m_button
Definition joysensorbuttonpushbutton.h:49
void tryFlash()
Highlights the button when mapped button is active.
Definition joysensorbuttonpushbutton.cpp:113
void showContextMenu(const QPoint &point)
Shows sensor context menu.
Definition joysensorbuttonpushbutton.cpp:102
bool isflashing
Definition joysensorbuttonpushbutton.h:30
void enableFlashes() override
Enables highlight when the sensor axis is moved.
Definition joysensorbuttonpushbutton.cpp:64
virtual QString generateLabel() override
Generate the string that will be displayed on the button.
Definition joysensorbuttonpushbutton.cpp:77
JoySensorButton * getButton()
Get the JoySensorButton for this mapping.
Definition joysensorbuttonpushbutton.cpp:46
void disableFlashes() override
Disables highlight when the sensor axis is moved.
Definition joysensorbuttonpushbutton.cpp:51
Represents a sensor mapping in a SetJoystick.
Definition joysensorbutton.h:31