AntiMicroX
joysensorpreset.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 
20 
24 class JoySensorPreset : public QObject
25 {
26  Q_OBJECT
27 
28  public:
29  enum Preset
30  {
39  };
40 
41  explicit JoySensorPreset(JoySensor *sensor, QObject *parent = nullptr);
42 
43  QList<Preset> getAvailablePresets();
45  QString getPresetName(Preset);
46  void setSensorPreset(Preset);
48 
49  private:
52 };
JoyButtonSlot::MouseDown
@ MouseDown
Definition: joybuttonslot.h:65
JoySensorPreset::setSensorPreset
void setSensorPreset(Preset)
Assigns given preset to the underlying sensor This function defines the preset mappings and sensor pa...
Definition: joysensorpreset.cpp:250
SENSOR_FWD
@ SENSOR_FWD
Definition: joysensordirection.h:34
JoySensorPreset::getPresetName
QString getPresetName(Preset)
Get the translated name of a given preset.
Definition: joysensorpreset.cpp:212
JoySensorPreset::PRESET_WASD
@ PRESET_WASD
Definition: joysensorpreset.h:37
JoyButtonSlot::getSlotMode
JoySlotInputAction getSlotMode() const
Definition: joybuttonslot.cpp:114
antkeymapper.h
joysensor.h
JoySensorPreset::PRESET_NUMPAD
@ PRESET_NUMPAD
Definition: joysensorpreset.h:38
JoySensorPreset::PRESET_MOUSE_INV_HV
@ PRESET_MOUSE_INV_HV
Definition: joysensorpreset.h:35
SENSOR_LEFT
@ SENSOR_LEFT
Definition: joysensordirection.h:30
JoySensorPreset::PRESET_MOUSE_INV_H
@ PRESET_MOUSE_INV_H
Definition: joysensorpreset.h:33
JoySensorPreset
Defines presets for a sensor.
Definition: joysensorpreset.h:24
QtKeyMapperBase::AntKey_KP_8
@ AntKey_KP_8
Definition: qtkeymapperbase.h:81
JoySensorPreset::PRESET_NONE
@ PRESET_NONE
Definition: joysensorpreset.h:31
JoyButtonSlot::JoyMouseMovement
@ JoyMouseMovement
Definition: joybuttonslot.h:46
JoyButtonSlot
Represents action which can be performed after pressing button.
Definition: joybuttonslot.h:37
JoySensorPreset::Preset
Preset
Definition: joysensorpreset.h:29
AntKeyMapper::returnVirtualKey
int returnVirtualKey(int qkey)
Definition: antkeymapper.cpp:104
joysensorpreset.h
JoyButtonSlot::JoyKeyboard
@ JoyKeyboard
Definition: joybuttonslot.h:44
JoyButton::getAssignedSlots
QList< JoyButtonSlot * > * getAssignedSlots()
Definition: joybutton.cpp:2390
AntKeyMapper::getInstance
static AntKeyMapper * getInstance(QString handler="")
Definition: antkeymapper.cpp:80
JoySensorPreset::JoySensorPreset
JoySensorPreset(JoySensor *sensor, QObject *parent=nullptr)
Definition: joysensorpreset.cpp:25
SENSOR_DOWN
@ SENSOR_DOWN
Definition: joysensordirection.h:33
JoySensorPreset::PRESET_ARROWS
@ PRESET_ARROWS
Definition: joysensorpreset.h:36
JoySensorButton
Represents a sensor mapping in a SetJoystick.
Definition: joysensorbutton.h:30
JoyButtonSlot::MouseUp
@ MouseUp
Definition: joybuttonslot.h:64
QtKeyMapperBase::AntKey_KP_6
@ AntKey_KP_6
Definition: qtkeymapperbase.h:79
JoyButtonSlot::getSlotCode
int getSlotCode() const
Definition: joybuttonslot.cpp:110
JoySensor::getType
JoySensorType getType() const
Returns the sensor type.
Definition: joysensor.cpp:247
JoyButtonSlot::MouseLeft
@ MouseLeft
Definition: joybuttonslot.h:66
JoySensorPreset::PRESET_MOUSE_INV_V
@ PRESET_MOUSE_INV_V
Definition: joysensorpreset.h:34
JoyButtonSlot::MouseRight
@ MouseRight
Definition: joybuttonslot.h:67
JoySensorPreset::PRESET_MOUSE
@ PRESET_MOUSE
Definition: joysensorpreset.h:32
common.h
QtKeyMapperBase::AntKey_KP_2
@ AntKey_KP_2
Definition: qtkeymapperbase.h:75
SENSOR_UP
@ SENSOR_UP
Definition: joysensordirection.h:32
JoySensor
Represents one sensor in a SetJoystick and its connections to other parts of the application....
Definition: joysensor.h:39
SENSOR_RIGHT
@ SENSOR_RIGHT
Definition: joysensordirection.h:31
JoySensorPreset::getHelper
JoySensorIoThreadHelper & getHelper()
Get the internal JoySensorIoThreadHelper.
Definition: joysensorpreset.cpp:371
joysensorbutton.h
JoySensorPreset::getAvailablePresets
QList< Preset > getAvailablePresets()
Get available presets for the underlying sensor type.
Definition: joysensorpreset.cpp:37
GYROSCOPE
@ GYROSCOPE
Definition: joysensortype.h:26
joysensoriothreadhelper.h
QtKeyMapperBase::AntKey_KP_4
@ AntKey_KP_4
Definition: qtkeymapperbase.h:77
JoySensorPreset::m_sensor
JoySensor * m_sensor
Definition: joysensorpreset.h:50
JoySensor::getDirectionButton
JoySensorButton * getDirectionButton(JoySensorDirection direction)
Get a pointer to the sensor direction button for the desired direction.
Definition: joysensor.cpp:550
SENSOR_BWD
@ SENSOR_BWD
Definition: joysensordirection.h:35
PadderCommon::inputDaemonMutex
QMutex inputDaemonMutex
Definition: common.cpp:223
JoySensorIoThreadHelper
Some helper methods which run in the IO thread and are called from the GUI thread.
Definition: joysensoriothreadhelper.h:31
JoySensorPreset::currentPreset
Preset currentPreset()
Determines the preset used by the underlying sensor.
Definition: joysensorpreset.cpp:62
JoySensorPreset::m_helper
JoySensorIoThreadHelper m_helper
Definition: joysensorpreset.h:51
ACCELEROMETER
@ ACCELEROMETER
Definition: joysensortype.h:25
JoySensorIoThreadHelper::setPendingSlots
void setPendingSlots(QHash< JoySensorDirection, JoyButtonSlot * > *tempSlots)
Sets pending slot values The values are applied to the buttons by calling setFromPendingSlots.
Definition: joysensoriothreadhelper.cpp:39