AntiMicroX
Loading...
Searching...
No Matches
joysensorbutton.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#include "joysensordirection.h"
21#include "joysensortype.h"
22#include "logger.h"
23
24class SetJoystick;
25class JoySensor;
26
31{
33
34 public:
35 explicit JoySensorButton(JoySensor *sensor, int index, int originset, SetJoystick *parentSet, QObject *parent);
36
37 virtual int getRealJoyNumber() const override;
38 virtual QString getPartialName(bool forceFullFormat = false, bool displayNames = false) const override;
39 virtual QString getXmlName() override;
40
41 virtual double getDistanceFromDeadZone() override;
42 virtual double getMouseDistanceFromDeadZone() override;
43
45 bool updateActiveString = true) override;
46 virtual bool isPartRealAxis() override;
47 virtual JoyMouseCurve getDefaultMouseCurve() const override;
48
49 JoySensor *getSensor() const;
50 virtual QString getDirectionName() const = 0;
52
53 signals:
55
56 private:
58};
SetChangeCondition
Definition joybutton.h:55
JoyMouseCurve
Definition joybutton.h:68
Definition joydpadxml.h:27
Definition joygradientbutton.h:27
Represents a sensor mapping in a SetJoystick.
Definition joysensorbutton.h:31
virtual QString getDirectionName() const =0
virtual QString getPartialName(bool forceFullFormat=false, bool displayNames=false) const override
Get the name of the button. Shows the sensor direction name instead of a button number.
Definition joysensorbutton.cpp:50
JoySensor * getSensor() const
Get the JoySensor associated to this button.
Definition joysensorbutton.cpp:152
virtual JoyMouseCurve getDefaultMouseCurve() const override
Returns the default mouse curve for JoySensorButtons.
Definition joysensorbutton.cpp:146
virtual double getMouseDistanceFromDeadZone() override
Get the distance factor that should be used for mouse movement.
Definition joysensorbutton.cpp:92
virtual bool isPartRealAxis() override
Check if button should be considered a part of a real controller axis. Needed for some dialogs so the...
Definition joysensorbutton.cpp:140
JoySensorDirection getDirection() const
returns the direction of this button.
Definition joysensorbutton.cpp:157
virtual double getDistanceFromDeadZone() override
Get the distance that an element is away from its assigned dead zone.
Definition joysensorbutton.cpp:83
virtual int getRealJoyNumber() const override
Get a 0 indexed number of button.
Definition joysensorbutton.cpp:43
virtual QString getXmlName() override
Get the XML tag name of this button type.
Definition joysensorbutton.cpp:77
JoySensor * m_sensor
Definition joysensorbutton.h:57
virtual void setChangeSetCondition(SetChangeCondition condition, bool passive=false, bool updateActiveString=true) override
Definition joysensorbutton.cpp:97
void setAssignmentChanged(JoySensorDirection direction, JoySensorType type, int associated_set, int mode)
Represents one sensor in a SetJoystick and its connections to other parts of the application....
Definition joysensor.h:40
A set of mapped events which can by switched by a controller event. Contains controller input objects...
Definition setjoystick.h:40
JoySensorDirection
A bitfield style enum which encodes all possible three dimensional sensor directions....
Definition joysensordirection.h:28
JoySensorType
Definition joysensortype.h:24