AntiMicroX
axiseditdialog.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 AXISEDITDIALOG_H
20 #define AXISEDITDIALOG_H
21 
22 #include <QDialog>
23 
24 class JoyAxis;
26 class QWidget;
27 
28 namespace Ui {
29 class AxisEditDialog;
30 }
31 
32 class AxisEditDialog : public QDialog
33 {
34  Q_OBJECT
35 
36  public:
37  explicit AxisEditDialog(JoyAxis *axis, bool keypadUnlocked, QWidget *parent = 0);
38  AxisEditDialog(QWidget *parent = 0);
40 
41  protected:
43  void selectTriggerPreset();
44  void selectHapticTrigger();
45 
47  void buildAxisPresetsMenu();
49 
50  private:
55  {
61  };
62  Ui::AxisEditDialog *ui;
63 
68 
69  private slots:
70  void implementAxisPresets(int index);
71  void implementTriggerPresets(int index);
72  void implementPresets(int index);
73  void presetForThrottleChange(int index);
74  void implementHapticTrigger(int index);
75 
76  void updateDeadZoneBox(int value);
77  void updateMaxZoneBox(int value);
78  void updateThrottleUi(int index);
79  void updateJoyValue(int value);
80  void updateDeadZoneSlider(int value);
81  void updateMaxZoneSlider(int value);
82  void openAdvancedPDialog();
83  void openAdvancedNDialog();
84 
85  void refreshPButtonLabel();
86  void refreshNButtonLabel();
87  void refreshPreset();
88 
89  void checkFinalSettings();
93 };
94 
95 #endif // AXISEDITDIALOG_H
AxisEditDialog::initialThrottleState
int initialThrottleState
Definition: axiseditdialog.h:67
AxisEditDialog::m_axis
JoyAxis * m_axis
Definition: axiseditdialog.h:64
AxisEditDialog::presetForThrottleChange
void presetForThrottleChange(int index)
Definition: axiseditdialog.cpp:667
JoyButtonSlot::MouseDown
@ MouseDown
Definition: joybuttonslot.h:65
SetJoystick::getIndex
int getIndex() const
Definition: setjoystick.cpp:507
JoyAxis::setDeadZone
void setDeadZone(int value)
Definition: joyaxis.cpp:354
JoyAxis::setThrottle
void setThrottle(int value)
Set throttle value for axis.
Definition: joyaxis.cpp:388
AxisEditDialog::selectHapticTrigger
void selectHapticTrigger()
Converts HapticTriggerMode from the current axis to combo box index and selects to element.
Definition: axiseditdialog.cpp:513
joycontrolstick.h
MouseAxisSettingsDialog
Definition: mouseaxissettingsdialog.h:30
AxisEditDialog::setAxisThrottleConfirm
SetAxisThrottleDialog * setAxisThrottleConfirm
Definition: axiseditdialog.h:66
JoyAxis
Represents single axis of of joystick (or other input)
Definition: joyaxis.h:40
AxisEditDialog::updateDeadZoneBox
void updateDeadZoneBox(int value)
Definition: axiseditdialog.cpp:317
JoyAxis::getHapticTrigger
virtual HapticTriggerPs5 * getHapticTrigger() const
Always returns nullptr for JoyAxis base objects.
Definition: joyaxis.cpp:307
JoyAxis::NormalThrottle
@ NormalThrottle
Definition: joyaxis.h:52
axiseditdialog.h
AxisEditDialog::buildTriggerPresetsMenu
void buildTriggerPresetsMenu()
Definition: axiseditdialog.cpp:648
AxisEditDialog::implementPresets
void implementPresets(int index)
Definition: axiseditdialog.cpp:182
SetJoystick::getName
QString getName() const
Definition: setjoystick.cpp:948
AxisEditDialog::updateMaxZoneSlider
void updateMaxZoneSlider(int value)
Definition: axiseditdialog.cpp:358
HAPTIC_TRIGGER_CLICK
@ HAPTIC_TRIGGER_CLICK
Definition: haptictriggermodeps5.h:25
JoyButtonSlot::getSlotMode
JoySlotInputAction getSlotMode() const
Definition: joybuttonslot.cpp:114
antkeymapper.h
JoyButtonSlot::JoyMouseButton
@ JoyMouseButton
Definition: joybuttonslot.h:45
JoyAxis::NegativeHalfThrottle
@ NegativeHalfThrottle
Definition: joyaxis.h:50
ButtonEditDialog
Definition: buttoneditdialog.h:37
JoyButtonSlot::MouseRB
@ MouseRB
Definition: joybuttonslot.h:80
AxisEditDialog::updateDeadZoneSlider
void updateDeadZoneSlider(int value)
Definition: axiseditdialog.cpp:350
InputDevice
Abstract class representing a hardware input device, e.g a joystick or controller.
Definition: inputdevice.h:50
JoyAxis::PositiveThrottle
@ PositiveThrottle
Definition: joyaxis.h:53
JoyAxis::getDeadZone
int getDeadZone()
Definition: joyaxis.cpp:365
JoyAxis::getMaxZoneValue
int getMaxZoneValue()
Definition: joyaxis.cpp:382
AxisEditDialog::HapticTriggerIndex
HapticTriggerIndex
Haptic trigger combo box indices.
Definition: axiseditdialog.h:54
AxisEditDialog::selectAxisCurrentPreset
void selectAxisCurrentPreset()
Definition: axiseditdialog.cpp:396
AxisEditDialog::checkFinalSettings
void checkFinalSettings()
Definition: axiseditdialog.cpp:390
setaxisthrottledialog.h
AxisEditDialog::updateMaxZoneBox
void updateMaxZoneBox(int value)
Definition: axiseditdialog.cpp:319
AxisEditDialog::~AxisEditDialog
~AxisEditDialog()
Definition: axiseditdialog.cpp:180
AxisEditDialog::implementHapticTrigger
void implementHapticTrigger(int index)
Converts the haptic trigger combo box index to a HapticTriggerMode and applies it to the current axis...
Definition: axiseditdialog.cpp:701
JoyButton::getParentSet
SetJoystick * getParentSet()
Definition: joybutton.cpp:3976
AxisEditDialog::HAPTIC_TRIGGER_NONE_INDEX
@ HAPTIC_TRIGGER_NONE_INDEX
Definition: axiseditdialog.h:56
JoyAxis::getThrottle
int getThrottle()
Definition: joyaxis.cpp:423
JoyAxis::getPAxisButton
JoyAxisButton * getPAxisButton()
Definition: joyaxis.cpp:459
mouseaxissettingsdialog.h
PadderCommon::lockInputDevices
void lockInputDevices()
Definition: common.cpp:158
QtKeyMapperBase::AntKey_KP_8
@ AntKey_KP_8
Definition: qtkeymapperbase.h:81
JoyButtonSlot::JoyMouseMovement
@ JoyMouseMovement
Definition: joybuttonslot.h:46
JoyButtonSlot
Represents action which can be performed after pressing button.
Definition: joybuttonslot.h:37
haptictriggerps5.h
JoyAxis::axisNameChanged
void axisNameChanged()
AxisEditDialog::selectTriggerPreset
void selectTriggerPreset()
Definition: axiseditdialog.cpp:480
AxisEditDialog::refreshNButtonLabel
void refreshNButtonLabel()
Definition: axiseditdialog.cpp:386
Ui
Definition: aboutdialog.h:26
AntKeyMapper::returnVirtualKey
int returnVirtualKey(int qkey)
Definition: antkeymapper.cpp:104
JoyButtonSlot::JoyKeyboard
@ JoyKeyboard
Definition: joybuttonslot.h:44
JoyButton::getAssignedSlots
QList< JoyButtonSlot * > * getAssignedSlots()
Definition: joybutton.cpp:2390
JoyAxis::getParentSet
SetJoystick * getParentSet()
Definition: joyaxis.cpp:777
JoyAxis::setMaxZoneValue
void setMaxZoneValue(int value)
Definition: joyaxis.cpp:367
AntKeyMapper::getInstance
static AntKeyMapper * getInstance(QString handler="")
Definition: antkeymapper.cpp:80
HAPTIC_TRIGGER_RIGID
@ HAPTIC_TRIGGER_RIGID
Definition: haptictriggermodeps5.h:26
AxisEditDialog::updateWindowTitleAxisName
void updateWindowTitleAxisName()
Definition: axiseditdialog.cpp:604
AxisEditDialog::enableMouseSettingButton
void enableMouseSettingButton()
Definition: axiseditdialog.cpp:602
HAPTIC_TRIGGER_RIGID_GRADIENT
@ HAPTIC_TRIGGER_RIGID_GRADIENT
Definition: haptictriggermodeps5.h:27
AxisEditDialog::HAPTIC_TRIGGER_VIBRATION_INDEX
@ HAPTIC_TRIGGER_VIBRATION_INDEX
Definition: axiseditdialog.h:60
SetJoystick::getRealIndex
int getRealIndex() const
Definition: setjoystick.cpp:509
JoyAxis::setHapticTriggerMode
virtual void setHapticTriggerMode(HapticTriggerModePs5)
Changes the haptic trigger effect mode.
Definition: joyaxis.cpp:313
JoyButton::getActionName
QString getActionName()
Definition: joybutton.cpp:3586
JoyAxis::PositiveHalfThrottle
@ PositiveHalfThrottle
Definition: joyaxis.h:54
event.h
AxisEditDialog::buildHapticTriggerMenu
void buildHapticTriggerMenu()
Definition: axiseditdialog.cpp:657
JoyButtonSlot::MouseUp
@ MouseUp
Definition: joybuttonslot.h:64
QtKeyMapperBase::AntKey_KP_6
@ AntKey_KP_6
Definition: qtkeymapperbase.h:79
JoyAxis::moved
void moved(int value)
inputdevice.h
JoyButtonSlot::getSlotCode
int getSlotCode() const
Definition: joybuttonslot.cpp:110
JoyButton::getSlotsSummary
virtual QString getSlotsSummary()
Generate a string representing a summary of the slots currently assigned to a button.
Definition: joybutton.cpp:1630
GlobalVariables::JoyAxis::AXISMIN
static const int AXISMIN
Definition: globalvariables.h:117
JoyButtonSlot::MouseLeft
@ MouseLeft
Definition: joybuttonslot.h:66
GlobalVariables::JoyAxis::AXISMAX
static const int AXISMAX
Definition: globalvariables.h:118
HAPTIC_TRIGGER_NONE
@ HAPTIC_TRIGGER_NONE
Definition: haptictriggermodeps5.h:24
AxisEditDialog::updateThrottleUi
void updateThrottleUi(int index)
Definition: axiseditdialog.cpp:321
JoyAxis::NegativeThrottle
@ NegativeThrottle
Definition: joyaxis.h:51
AxisEditDialog::HAPTIC_TRIGGER_CLICK_INDEX
@ HAPTIC_TRIGGER_CLICK_INDEX
Definition: axiseditdialog.h:57
AxisEditDialog::openMouseSettingsDialog
void openMouseSettingsDialog()
Definition: axiseditdialog.cpp:592
JoyButton::buildActiveZoneSummaryString
void buildActiveZoneSummaryString()
Generate active zone string and notify other objects.
Definition: joybutton.cpp:1684
AxisEditDialog::openAdvancedNDialog
void openAdvancedNDialog()
Definition: axiseditdialog.cpp:376
JoyButtonSlot::MouseRight
@ MouseRight
Definition: joybuttonslot.h:67
JoyAxisButton
Definition: joyaxisbutton.h:29
HapticTriggerModePs5
HapticTriggerModePs5
Enum of the supported haptic trigger effect for a PS5 controller.
Definition: haptictriggermodeps5.h:22
AxisEditDialog::HAPTIC_TRIGGER_RIGID_INDEX
@ HAPTIC_TRIGGER_RIGID_INDEX
Definition: axiseditdialog.h:58
AxisEditDialog::HAPTIC_TRIGGER_RIGID_GRADIENT_INDEX
@ HAPTIC_TRIGGER_RIGID_GRADIENT_INDEX
Definition: axiseditdialog.h:59
AxisEditDialog
Definition: axiseditdialog.h:32
common.h
JoyAxis::getAxisName
virtual QString getAxisName()
Definition: joyaxis.cpp:722
axisvaluebox.h
buttoneditdialog.h
AxisEditDialog::buildAxisPresetsMenu
void buildAxisPresetsMenu()
Definition: axiseditdialog.cpp:631
SetAxisThrottleDialog
Definition: setaxisthrottledialog.h:31
QtKeyMapperBase::AntKey_KP_2
@ AntKey_KP_2
Definition: qtkeymapperbase.h:75
JoyAxis::getPartialName
virtual QString getPartialName(bool forceFullFormat=false, bool displayNames=false)
Definition: joyaxis.cpp:740
joyaxis.h
AxisEditDialog::implementAxisPresets
void implementAxisPresets(int index)
Definition: axiseditdialog.cpp:199
AxisEditDialog::keypadUnlocked
bool keypadUnlocked
Definition: axiseditdialog.h:65
SetJoystick::getInputDevice
InputDevice * getInputDevice() const
Definition: setjoystick.cpp:931
JoyAxis::getNAxisButton
JoyAxisButton * getNAxisButton()
Definition: joyaxis.cpp:461
setjoystick.h
JoyAxis::hasHapticTrigger
virtual bool hasHapticTrigger() const
Checks if the axis supports haptic trigger feedback.
Definition: joyaxis.cpp:302
AxisEditDialog::implementTriggerPresets
void implementTriggerPresets(int index)
Definition: axiseditdialog.cpp:537
AxisEditDialog::refreshPButtonLabel
void refreshPButtonLabel()
Definition: axiseditdialog.cpp:388
AxisEditDialog::refreshPreset
void refreshPreset()
Definition: axiseditdialog.cpp:581
HapticTriggerPs5::get_mode
HapticTriggerModePs5 get_mode() const
Returns the current haptic feedback effect mode.
Definition: haptictriggerps5.cpp:243
JoyButtonSlot::getSlotCodeAlias
int getSlotCodeAlias() const
Definition: joybuttonslot.cpp:108
QtKeyMapperBase::AntKey_KP_4
@ AntKey_KP_4
Definition: qtkeymapperbase.h:77
AxisEditDialog::updateJoyValue
void updateJoyValue(int value)
Definition: axiseditdialog.cpp:348
PadderCommon::unlockInputDevices
void unlockInputDevices()
Definition: common.cpp:160
JoyButtonSlot::JoySlotInputAction
JoySlotInputAction
Definition: joybuttonslot.h:42
number
it is up to the author donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License If the distribution and or use of the Library is restricted in certain countries either by patents or by copyrighted the original copyright holder who places the Library under this License may add an geographical distribution limitation excluding those so that distribution is permitted only in or among countries not thus excluded In such this License incorporates the limitation as if written in the body of this License The Free Software Foundation may publish revised and or new versions of the Lesser General Public License from time to time Such new versions will be similar in spirit to the present but may differ in detail to address new problems or concerns Each version is given a distinguishing version number If the Library specifies a version number of this License which applies to it and any later you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation If the Library does not specify a license version number
Definition: lgpl-2.1.txt:423
JoyButtonSlot::MouseLB
@ MouseLB
Definition: joybuttonslot.h:78
JoyAxis::setAxisName
void setAxisName(QString tempName)
Definition: joyaxis.cpp:712
AxisEditDialog::ui
Ui::AxisEditDialog * ui
Definition: axiseditdialog.h:62
HAPTIC_TRIGGER_VIBRATION
@ HAPTIC_TRIGGER_VIBRATION
Definition: haptictriggermodeps5.h:28
AxisEditDialog::AxisEditDialog
AxisEditDialog(JoyAxis *axis, bool keypadUnlocked, QWidget *parent=0)
Definition: axiseditdialog.cpp:38
AxisEditDialog::openAdvancedPDialog
void openAdvancedPDialog()
Definition: axiseditdialog.cpp:366
JoyAxis::getCurrentRawValue
int getCurrentRawValue()
Definition: joyaxis.cpp:463