AntiMicroX
Loading...
Searching...
No Matches
joystick.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 JOYSTICK_H
20#define JOYSTICK_H
21
22#include "inputdevice.h"
23
24#include <SDL2/SDL_gamecontroller.h>
25
27
34class Joystick : public InputDevice
35{
37
38 public:
39 explicit Joystick(SDL_Joystick *joyhandle, int deviceIndex, AntiMicroSettings *settings, QObject *parent);
40
41 virtual QString getName() override;
42 virtual QString getSDLName() override;
43 virtual QString getGUIDString() const override; // GUID available on SDL 2.
44 virtual QString getUniqueIDString() const override;
45 virtual QString getVendorString() const override;
46 virtual QString getProductIDString() const override;
47 virtual QString getSerialString() const override;
48 virtual QString getProductVersion() const override;
49
50 virtual void closeSDLDevice() override;
51 virtual SDL_JoystickID getSDLJoystickID() override;
52
53 virtual int getNumberRawButtons() override;
54 virtual int getNumberRawAxes() override;
55 virtual int getNumberRawHats() override;
56 virtual double getRawSensorRate(JoySensorType type) override;
57 virtual bool hasRawSensor(JoySensorType type) override;
58
59 void setCounterUniques(int counter) override;
60
62 virtual QString getXmlName() const override;
63
64 private:
69};
70
72
73#endif // JOYSTICK_H
Definition antimicrosettings.h:27
Abstract class representing a hardware input device, e.g a joystick or controller.
Definition inputdevice.h:51
Definition joydpadxml.h:27
General input device (which is not a typical gamepad like steering wheels, flight sticks etc....
Definition joystick.h:35
int counterUniques
Definition joystick.h:68
virtual void closeSDLDevice() override
Definition joystick.cpp:143
virtual SDL_JoystickID getSDLJoystickID() override
Definition joystick.cpp:175
virtual double getRawSensorRate(JoySensorType type) override
Definition joystick.cpp:169
virtual QString getGUIDString() const override
Definition joystick.cpp:63
virtual int getNumberRawAxes() override
Definition joystick.cpp:157
SDL_Joystick * getJoyhandle() const
Definition joystick.cpp:177
virtual QString getSDLName() override
Definition joystick.cpp:51
SDL_Joystick * m_joyhandle
Definition joystick.h:65
virtual QString getProductVersion() const override
Definition joystick.cpp:122
virtual QString getSerialString() const override
Definition joystick.cpp:108
virtual QString getVendorString() const override
Definition joystick.cpp:76
SDL_JoystickID joystickID
Definition joystick.h:67
virtual QString getName() override
Definition joystick.cpp:49
virtual QString getProductIDString() const override
Definition joystick.cpp:92
virtual bool hasRawSensor(JoySensorType type) override
Definition joystick.cpp:171
virtual QString getUniqueIDString() const override
Definition joystick.cpp:138
virtual QString getXmlName() const override
Definition joystick.cpp:47
SDL_GameController * controller
Definition joystick.h:66
virtual int getNumberRawButtons() override
Definition joystick.cpp:151
virtual int getNumberRawHats() override
Definition joystick.cpp:163
void setCounterUniques(int counter) override
Definition joystick.cpp:173
JoySensorType
Definition joysensortype.h:24