AntiMicroX
Loading...
Searching...
No Matches
src
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
22
#include "
uihelpers/dpadcontextmenuhelper.h
"
23
24
#include <QActionGroup>
25
#include <QMenu>
26
27
class
JoyDPad
;
28
class
QWidget;
29
30
class
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);
44
void
openMouseSettingsDialog
();
45
46
private
:
47
DPadContextMenuHelper
&
getHelper
();
48
49
JoyDPad
*
dpad
;
50
DPadContextMenuHelper
helper
;
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
DPadContextMenuHelper
Definition
dpadcontextmenuhelper.h:27
DPadContextMenu
Definition
dpadcontextmenu.h:31
DPadContextMenu::setDPadMode
void setDPadMode(QAction *action)
Set the appropriate mode for a DPad based on the item chosen.
Definition
dpadcontextmenu.cpp:112
DPadContextMenu::generateActionMode
void generateActionMode(QActionGroup *modesGroup, QAction *action, QString actionText, int currentPreset, int presetMode)
Definition
dpadcontextmenu.cpp:96
DPadContextMenu::getPresetIndex
int getPresetIndex()
Find the appropriate menu item index for the currently assigned slots that are assigned to a DPad.
Definition
dpadcontextmenu.cpp:311
DPadContextMenu::setDPadPreset
void setDPadPreset(QAction *action)
Assign the appropriate slots to DPad buttons based on the preset item that was chosen.
Definition
dpadcontextmenu.cpp:122
DPadContextMenu::openMouseSettingsDialog
void openMouseSettingsDialog()
Open a mouse settings dialog for changing the mouse speed settings for all DPad buttons.
Definition
dpadcontextmenu.cpp:424
DPadContextMenu::dpad
JoyDPad * dpad
Definition
dpadcontextmenu.h:49
DPadContextMenu::getHelper
DPadContextMenuHelper & getHelper()
Definition
dpadcontextmenu.cpp:430
DPadContextMenu::buildMenu
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
DPadContextMenu::helper
DPadContextMenuHelper helper
Definition
dpadcontextmenu.h:50
DPadContextMenu::generateActionPreset
void generateActionPreset(QAction *action, QString actionText, int currentPreset, int &presetMode, QActionGroup *presetGroup)
Definition
dpadcontextmenu.cpp:82
JoyDPad
Definition
joydpad.h:25
dpadcontextmenuhelper.h
Generated by
1.9.8