AntiMicroX
Loading...
Searching...
No Matches
dpadcontextmenu.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 DPADCONTEXTMENU_H
20#define DPADCONTEXTMENU_H
21
23
24#include <QActionGroup>
25#include <QMenu>
26
27class JoyDPad;
28class QWidget;
29
30class DPadContextMenu : public QMenu
31{
32 Q_OBJECT
33
34 public:
35 explicit DPadContextMenu(JoyDPad *dpad, QWidget *parent = nullptr);
36 void buildMenu();
37
38 protected:
39 int getPresetIndex();
40
41 private slots:
42 void setDPadPreset(QAction *action);
43 void setDPadMode(QAction *action);
45
46 private:
48
51
52 void generateActionPreset(QAction *action, QString actionText, int currentPreset, int &presetMode,
53 QActionGroup *presetGroup);
54 void generateActionMode(QActionGroup *modesGroup, QAction *action, QString actionText, int currentPreset,
55 int presetMode);
56};
57
58#endif // DPADCONTEXTMENU_H
Definition dpadcontextmenuhelper.h:27
Definition dpadcontextmenu.h:31
void setDPadMode(QAction *action)
Set the appropriate mode for a DPad based on the item chosen.
Definition dpadcontextmenu.cpp:112
void generateActionMode(QActionGroup *modesGroup, QAction *action, QString actionText, int currentPreset, int presetMode)
Definition dpadcontextmenu.cpp:96
int getPresetIndex()
Find the appropriate menu item index for the currently assigned slots that are assigned to a DPad.
Definition dpadcontextmenu.cpp:311
void setDPadPreset(QAction *action)
Assign the appropriate slots to DPad buttons based on the preset item that was chosen.
Definition dpadcontextmenu.cpp:122
void openMouseSettingsDialog()
Open a mouse settings dialog for changing the mouse speed settings for all DPad buttons.
Definition dpadcontextmenu.cpp:424
JoyDPad * dpad
Definition dpadcontextmenu.h:49
DPadContextMenuHelper & getHelper()
Definition dpadcontextmenu.cpp:430
void buildMenu()
Generate the context menu that will be shown to a user when the person right clicks on the DPad setti...
Definition dpadcontextmenu.cpp:45
DPadContextMenuHelper helper
Definition dpadcontextmenu.h:50
void generateActionPreset(QAction *action, QString actionText, int currentPreset, int &presetMode, QActionGroup *presetGroup)
Definition dpadcontextmenu.cpp:82
Definition joydpad.h:25