AntiMicroX
joycontrolstickeditdialog.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 JOYCONTROLSTICKEDITDIALOG_H
20 #define JOYCONTROLSTICKEDITDIALOG_H
21 
23 
24 #include <QDialog>
25 
26 class JoyControlStick;
27 class QWidget;
28 
29 namespace Ui {
31 }
32 
33 class JoyControlStickEditDialog : public QDialog
34 {
35  Q_OBJECT
36 
37  public:
38  explicit JoyControlStickEditDialog(JoyControlStick *stick, bool keypadUnlocked, QWidget *parent = nullptr);
39  // JoyControlStickEditDialog(QWidget *parent = nullptr);
41 
42  protected:
43  void selectCurrentPreset();
44 
45  private:
46  Ui::JoyControlStickEditDialog *ui;
49 
52 
53  private slots:
54  void implementPresets(int index);
55  void implementModes(int index);
56 
57  void refreshStickStats(int x, int y);
58  void updateMouseMode(int index);
59 
60  void checkMaxZone(int value);
64  void changeCircleAdjust(int value);
65  void updateStickDelaySpinBox(int value);
66  void updateStickDelaySlider(double value);
68  void changeModifierSummary();
69 };
70 
71 #endif // JOYCONTROLSTICKEDITDIALOG_H
JoyControlStickEditDialog::checkMaxZone
void checkMaxZone(int value)
Definition: joycontrolstickeditdialog.cpp:422
joycontrolstickbutton.h
JoyButtonSlot::MouseDown
@ MouseDown
Definition: joybuttonslot.h:65
JoyStickDirectionsType::StickUp
@ StickUp
Definition: joycontrolstickdirectionstype.h:28
SetJoystick::getIndex
int getIndex() const
Definition: setjoystick.cpp:507
joycontrolstickmodifierbutton.h
joycontrolstick.h
QtKeyMapperBase::AntKey_KP_7
@ AntKey_KP_7
Definition: qtkeymapperbase.h:80
JoyControlStick::getDeadZone
int getDeadZone()
Get the assigned dead zone value.
Definition: joycontrolstick.cpp:192
JoyControlStick::getStickName
QString getStickName()
Definition: joycontrolstick.cpp:2190
SetJoystick::getName
QString getName() const
Definition: setjoystick.cpp:948
JoyControlStickEditDialog::updateStickDelaySlider
void updateStickDelaySlider(double value)
Update QSlider value based on value from QDoubleSpinBox.
Definition: joycontrolstickeditdialog.cpp:644
JoyControlStick::setDiagonalRange
void setDiagonalRange(int value)
Set the diagonal range value for a stick.
Definition: joycontrolstick.cpp:970
JoyButtonSlot::getSlotMode
JoySlotInputAction getSlotMode() const
Definition: joybuttonslot.cpp:114
antkeymapper.h
JoyControlStick::getParentSet
SetJoystick * getParentSet()
Get pointer to the set that a stick belongs to.
Definition: joycontrolstick.cpp:2218
JoyControlStickEditDialog::openMouseSettingsDialog
void openMouseSettingsDialog()
Definition: joycontrolstickeditdialog.cpp:584
ButtonEditDialog
Definition: buttoneditdialog.h:37
QtKeyMapperBase::AntKey_KP_3
@ AntKey_KP_3
Definition: qtkeymapperbase.h:76
QtKeyMapperBase::AntKey_KP_9
@ AntKey_KP_9
Definition: qtkeymapperbase.h:82
JoyControlStick::getXCoordinate
int getXCoordinate()
Get the value for the corresponding X axis.
Definition: joycontrolstick.cpp:1674
JoyControlStickEditDialog::selectCurrentPreset
void selectCurrentPreset()
Definition: joycontrolstickeditdialog.cpp:471
JoyControlStick::getMaxZone
int getMaxZone()
Definition: joycontrolstick.cpp:832
JoyControlStickEditDialog::updateWindowTitleStickName
void updateWindowTitleStickName()
Definition: joycontrolstickeditdialog.cpp:596
JoyButton::MouseCursor
@ MouseCursor
Definition: joybutton.h:64
JoyControlStickEditDialog::JoyControlStickEditDialog
JoyControlStickEditDialog(JoyControlStick *stick, bool keypadUnlocked, QWidget *parent=nullptr)
Definition: joycontrolstickeditdialog.cpp:39
JoyControlStick::getAbsoluteRawDistance
double getAbsoluteRawDistance()
Get the raw radial distance of the stick. Values will be between 0 - 32,767.
Definition: joycontrolstick.cpp:691
JoyControlStickEditDialogHelper
Some helper methods which run in the IO thread and are called from the GUI thread.
Definition: joycontrolstickeditdialoghelper.h:30
joycontrolstickeditdialog.h
JoyControlStick::setButtonsMouseMode
void setButtonsMouseMode(JoyButton::JoyMouseMovementMode mode)
Definition: joycontrolstick.cpp:1907
JoyControlStick::moved
void moved(int xaxis, int yaxis)
JoyControlStickEditDialog::ui
Ui::JoyControlStickEditDialog * ui
Definition: joycontrolstickeditdialog.h:46
JoyControlStickEditDialog::enableMouseSettingButton
void enableMouseSettingButton()
Definition: joycontrolstickeditdialog.cpp:594
JoyControlStick::getDiagonalRange
int getDiagonalRange()
Get the assigned diagonal range value.
Definition: joycontrolstick.cpp:198
JoyControlStick::getPartialName
virtual QString getPartialName(bool forceFullFormat=false, bool displayNames=false)
Definition: joycontrolstick.cpp:798
joycontrolstickeditdialoghelper.h
JoyStickDirectionsType::StickRightUp
@ StickRightUp
Definition: joycontrolstickdirectionstype.h:32
QtKeyMapperBase::AntKey_KP_8
@ AntKey_KP_8
Definition: qtkeymapperbase.h:81
JoyControlStick::FourWayDiagonal
@ FourWayDiagonal
Definition: joycontrolstick.h:50
JoyControlStickEditDialog::changeModifierSummary
void changeModifierSummary()
Definition: joycontrolstickeditdialog.cpp:661
JoyControlStick::getCircleAdjust
double getCircleAdjust()
Get the current percentage of the outer square that should be ignored when performing the final axis ...
Definition: joycontrolstick.cpp:2763
JoyButtonSlot::JoyMouseMovement
@ JoyMouseMovement
Definition: joybuttonslot.h:46
JoyButtonSlot
Represents action which can be performed after pressing button.
Definition: joybuttonslot.h:37
JoyControlStick::getDistanceFromDeadZone
double getDistanceFromDeadZone()
Get current radial distance of the stick position past the assigned dead zone.
Definition: joycontrolstick.cpp:389
MouseControlStickSettingsDialog
Definition: mousecontrolsticksettingsdialog.h:30
JoyStickDirectionsType::StickDown
@ StickDown
Definition: joycontrolstickdirectionstype.h:30
Ui
Definition: aboutdialog.h:26
JoyControlStickButton
Definition: joycontrolstickbutton.h:28
AntKeyMapper::returnVirtualKey
int returnVirtualKey(int qkey)
Definition: antkeymapper.cpp:104
JoyControlStickEditDialogHelper::updateControlStickDelay
void updateControlStickDelay(int value)
Definition: joycontrolstickeditdialoghelper.cpp:91
JoyButtonSlot::JoyKeyboard
@ JoyKeyboard
Definition: joybuttonslot.h:44
JoyControlStick::setModifierZone
void setModifierZone(int value)
Sets the modifier zone of the stick to the given value.
Definition: joycontrolstick.cpp:898
JoyControlStick::getDirectionButton
JoyControlStickButton * getDirectionButton(JoyStickDirections direction)
Get a pointer to the stick direction button for the desired direction.
Definition: joycontrolstick.cpp:1179
JoyControlStickEditDialog::updateStickDelaySpinBox
void updateStickDelaySpinBox(int value)
Update QDoubleSpinBox value based on updated stick delay value.
Definition: joycontrolstickeditdialog.cpp:634
JoyControlStickEditDialog::openModifierEditDialog
void openModifierEditDialog()
Definition: joycontrolstickeditdialog.cpp:654
JoyButton::getAssignedSlots
QList< JoyButtonSlot * > * getAssignedSlots()
Definition: joybutton.cpp:2390
JoyControlStick::releaseButtonEvents
void releaseButtonEvents()
Definition: joycontrolstick.cpp:1870
AntKeyMapper::getInstance
static AntKeyMapper * getInstance(QString handler="")
Definition: antkeymapper.cpp:80
JoyStickDirectionsType::StickRight
@ StickRight
Definition: joycontrolstickdirectionstype.h:29
SetJoystick::getRealIndex
int getRealIndex() const
Definition: setjoystick.cpp:509
JoyControlStick::getModifierZoneInverted
bool getModifierZoneInverted() const
Checks if the modifier zone of this stick is inverted.
Definition: joycontrolstick.cpp:843
JoyStickDirectionsType::StickLeftUp
@ StickLeftUp
Definition: joycontrolstickdirectionstype.h:34
JoyControlStickEditDialog::refreshStickStats
void refreshStickStats(int x, int y)
Definition: joycontrolstickeditdialog.cpp:392
JoyControlStickEditDialog::changeCircleAdjust
void changeCircleAdjust(int value)
Definition: joycontrolstickeditdialog.cpp:625
event.h
JoyButtonSlot::MouseUp
@ MouseUp
Definition: joybuttonslot.h:64
JoyControlStick::EightWayMode
@ EightWayMode
Definition: joycontrolstick.h:48
QtKeyMapperBase::AntKey_KP_6
@ AntKey_KP_6
Definition: qtkeymapperbase.h:79
inputdevice.h
JoyButtonSlot::getSlotCode
int getSlotCode() const
Definition: joybuttonslot.cpp:110
JoyControlStickEditDialogHelper::setPendingSlots
void setPendingSlots(QHash< JoyControlStick::JoyStickDirections, JoyButtonSlot * > *tempSlots)
Definition: joycontrolstickeditdialoghelper.cpp:34
JoyButton::getSlotsSummary
virtual QString getSlotsSummary()
Generate a string representing a summary of the slots currently assigned to a button.
Definition: joybutton.cpp:1630
JoyButtonSlot::MouseLeft
@ MouseLeft
Definition: joybuttonslot.h:66
JoyControlStick::setDeadZone
void setDeadZone(int value)
Definition: joycontrolstick.cpp:870
JoyStickDirectionsType::StickLeft
@ StickLeft
Definition: joycontrolstickdirectionstype.h:31
JoyStickDirectionsType::StickLeftDown
@ StickLeftDown
Definition: joycontrolstickdirectionstype.h:35
JoyControlStick::getJoyMode
JoyMode getJoyMode()
Definition: joycontrolstick.cpp:1868
JoyControlStick
Represents stick of a joystick.
Definition: joycontrolstick.h:37
JoyButton::buildActiveZoneSummaryString
void buildActiveZoneSummaryString()
Generate active zone string and notify other objects.
Definition: joybutton.cpp:1684
JoyControlStick::getCircleYCoordinate
int getCircleYCoordinate()
Definition: joycontrolstick.cpp:1693
JoyButtonSlot::MouseRight
@ MouseRight
Definition: joybuttonslot.h:67
mousecontrolsticksettingsdialog.h
common.h
buttoneditdialog.h
JoyButton::establishPropertyUpdatedConnections
void establishPropertyUpdatedConnections()
Definition: joybutton.cpp:4034
QtKeyMapperBase::AntKey_KP_2
@ AntKey_KP_2
Definition: qtkeymapperbase.h:75
JoyControlStickEditDialog::implementModes
void implementModes(int index)
Definition: joycontrolstickeditdialog.cpp:430
JoyControlStickEditDialog::implementPresets
void implementPresets(int index)
Definition: joycontrolstickeditdialog.cpp:196
SetJoystick::getInputDevice
InputDevice * getInputDevice() const
Definition: setjoystick.cpp:931
JoyControlStickEditDialog::helper
JoyControlStickEditDialogHelper helper
Definition: joycontrolstickeditdialog.h:51
JoyButton::slotsChanged
void slotsChanged()
JoyControlStickEditDialog::~JoyControlStickEditDialog
~JoyControlStickEditDialog()
Definition: joycontrolstickeditdialog.cpp:194
JoyControlStick::getModifierZone
int getModifierZone() const
Returns the modifier zone of the stick.
Definition: joycontrolstick.cpp:837
JoyControlStick::getStickDelay
int getStickDelay()
Definition: joycontrolstick.cpp:2781
setjoystick.h
JoyControlStick::calculateBearing
double calculateBearing()
Calculate the bearing (in degrees) corresponding to the current position of the X and Y axes of a sti...
Definition: joycontrolstick.cpp:335
JoyControlStickEditDialog::updateMouseMode
void updateMouseMode(int index)
Definition: joycontrolstickeditdialog.cpp:569
QtKeyMapperBase::AntKey_KP_1
@ AntKey_KP_1
Definition: qtkeymapperbase.h:74
JoyControlStickEditDialog::getHelperLocal
JoyControlStickEditDialogHelper & getHelperLocal()
Definition: joycontrolstickeditdialog.cpp:666
JoyControlStick::stickDelayChanged
void stickDelayChanged(int value)
QtKeyMapperBase::AntKey_KP_4
@ AntKey_KP_4
Definition: qtkeymapperbase.h:77
JoyControlStick::FourWayCardinal
@ FourWayCardinal
Definition: joycontrolstick.h:49
JoyControlStick::StandardMode
@ StandardMode
Definition: joycontrolstick.h:47
JoyControlStickEditDialog
Definition: joycontrolstickeditdialog.h:33
JoyControlStick::setStickName
void setStickName(QString tempName)
Definition: joycontrolstick.cpp:2180
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
PadderCommon::inputDaemonMutex
QMutex inputDaemonMutex
Definition: common.cpp:223
JoyControlStick::getCircleXCoordinate
int getCircleXCoordinate()
Definition: joycontrolstick.cpp:1682
JoyControlStickEditDialog::stick
JoyControlStick * stick
Definition: joycontrolstickeditdialog.h:50
JoyControlStickEditDialog::keypadUnlocked
bool keypadUnlocked
Definition: joycontrolstickeditdialog.h:47
JoyButton::MouseSpring
@ MouseSpring
Definition: joybutton.h:65
JoyControlStick::getYCoordinate
int getYCoordinate()
Get the value for the corresponding Y axis.
Definition: joycontrolstick.cpp:1680
JoyControlStick::stickNameChanged
void stickNameChanged()
JoyStickDirectionsType::StickRightDown
@ StickRightDown
Definition: joycontrolstickdirectionstype.h:33
JoyControlStick::getModifierButton
JoyControlStickModifierButton * getModifierButton()
Definition: joycontrolstick.cpp:2821
JoyControlStick::setJoyMode
void setJoyMode(JoyMode mode)
Definition: joycontrolstick.cpp:1861