AntiMicroX
applaunchhelper.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 APPLAUNCHHELPER_H
20 #define APPLAUNCHHELPER_H
21 
22 #include <QObject>
23 
24 #include <SDL2/SDL_joystick.h>
25 
26 class AntiMicroSettings;
27 class InputDevice;
28 class QThread;
29 
30 class AppLaunchHelper : public QObject
31 {
32  Q_OBJECT
33 
34  public:
35  explicit AppLaunchHelper(AntiMicroSettings *settings, bool graphical = false, QObject *parent = 0);
36 
37  void printControllerList(QMap<SDL_JoystickID, InputDevice *> *joysticks);
38 
40 
41  protected:
46  void changeGamepadPollRate();
47 #ifdef Q_OS_WIN
48  void checkPointerPrecision();
49 #endif
50 
51  public slots:
52 #ifdef Q_OS_WIN
53  void appQuitPointerPrecision();
54 #endif
55  void initRunMethods();
56  void revertMouseThread();
57  void changeMouseThread(QThread *thread);
58 
59  private:
61  bool graphical;
62 };
63 
64 #endif // APPLAUNCHHELPER_H
JoyButton::indirectStaticMouseThread
static void indirectStaticMouseThread(QThread *thread, QTimer *staticMouseEventTimer, JoyButtonMouseHelper *mouseHelper)
Definition: joybutton.cpp:4564
GlobalVariables::JoyButton::MAXIMUMWEIGHTMODIFIER
static const double MAXIMUMWEIGHTMODIFIER
Definition: globalvariables.h:57
AppLaunchHelper::AppLaunchHelper
AppLaunchHelper(AntiMicroSettings *settings, bool graphical=false, QObject *parent=0)
Definition: applaunchhelper.cpp:34
AppLaunchHelper::changeSpringModeScreen
void changeSpringModeScreen()
Definition: applaunchhelper.cpp:128
globalvariables.h
JoyButton::setMouseHistorySize
static void setMouseHistorySize(int size, int maxMouseHistSize, int &mouseHistSize, QList< double > *mouseHistoryX, QList< double > *mouseHistoryY)
Set mouse history buffer size used for mouse smoothing.
Definition: joybutton.cpp:4241
PRINT_STDOUT
#define PRINT_STDOUT()
Macro used for printing messages to stdout.
Definition: logger.h:38
AppLaunchHelper::graphical
bool graphical
Definition: applaunchhelper.h:61
AppLaunchHelper::changeMouseThread
void changeMouseThread(QThread *thread)
Definition: applaunchhelper.cpp:172
AppLaunchHelper::settings
AntiMicroSettings * settings
Definition: applaunchhelper.h:60
AppLaunchHelper::enablePossibleMouseSmoothing
void enablePossibleMouseSmoothing()
Definition: applaunchhelper.cpp:56
InputDevice
Abstract class representing a hardware input device, e.g a joystick or controller.
Definition: inputdevice.h:50
AppLaunchHelper::revertMouseThread
void revertMouseThread()
Definition: applaunchhelper.cpp:166
WinExtras::isUsingEnhancedPointerPrecision
static bool isUsingEnhancedPointerPrecision()
Used to check if the "Enhance Pointer Precision" Windows option is currently enabled.
Definition: winextras.cpp:427
applaunchhelper.h
GlobalVariables::JoyButton::mouseRefreshRate
static int mouseRefreshRate
Definition: globalvariables.h:35
AppLaunchHelper
Definition: applaunchhelper.h:30
WinExtras::enablePointerPrecision
static void enablePointerPrecision()
If "Enhanced Pointer Precision" is currently disabled and the setting has not been changed explicitly...
Definition: winextras.cpp:411
GlobalVariables::JoyButton::mouseHistorySize
static int mouseHistorySize
Definition: globalvariables.h:33
GlobalVariables::JoyButton::springModeScreen
static int springModeScreen
Definition: globalvariables.h:36
GlobalVariables::JoyButton::gamepadRefreshRate
static int gamepadRefreshRate
Definition: globalvariables.h:38
JoyButton::getMouseHelper
static JoyButtonMouseHelper * getMouseHelper()
Definition: joybutton.cpp:4193
winextras.h
AntiMicroSettings
Definition: antimicrosettings.h:26
WinExtras::grabCurrentPointerPrecision
static void grabCurrentPointerPrecision()
Get the value of "Enhanced Pointer Precision" when the program first starts. Needed to not override s...
Definition: winextras.cpp:447
AppLaunchHelper::getSettings
AntiMicroSettings * getSettings() const
Definition: applaunchhelper.cpp:180
InputDevice::getDescription
virtual QString getDescription()
Definition: inputdevice.cpp:1310
GlobalVariables::JoyButton::mouseHistoryY
static QList< double > mouseHistoryY
Definition: globalvariables.h:89
JoyButton::getStaticMouseEventTimer
static QTimer * getStaticMouseEventTimer()
Definition: joybutton.cpp:4209
JoyButton::establishMouseTimerConnections
static void establishMouseTimerConnections()
Change initial settings used for mouse event timer being used by the application.
Definition: joybutton.cpp:4052
AntiMicroSettings::defaultDisabledWinEnhanced
static const bool defaultDisabledWinEnhanced
Definition: antimicrosettings.h:38
GlobalVariables::JoyButton::mouseHistoryX
static QList< double > mouseHistoryX
Definition: globalvariables.h:88
JoyButton::setMouseRefreshRate
static void setMouseRefreshRate(int refresh, int &mouseRefreshRate, int idleMouseRefrRate, JoyButtonMouseHelper *mouseHelper, QList< double > *mouseHistoryX, QList< double > *mouseHistoryY, QElapsedTimer *testOldMouseTime, QTimer *staticMouseEventTimer)
Set the mouse refresh rate when a mouse slot is active.
Definition: joybutton.cpp:4256
JoyButton::setStaticMouseThread
static void setStaticMouseThread(QThread *thread, QTimer *staticMouseEventTimer, QElapsedTimer *testOldMouseTime, int idleMouseRefrRate, JoyButtonMouseHelper *mouseHelper)
Definition: joybutton.cpp:4548
AppLaunchHelper::initRunMethods
void initRunMethods()
Definition: applaunchhelper.cpp:41
AppLaunchHelper::printControllerList
void printControllerList(QMap< SDL_JoystickID, InputDevice * > *joysticks)
Definition: applaunchhelper.cpp:106
inputdevice.h
joybutton.h
GlobalVariables::AntimicroSettings::defaultSpringScreen
static const int defaultSpringScreen
Definition: globalvariables.h:97
AppLaunchHelper::establishMouseTimerConnections
void establishMouseTimerConnections()
Definition: applaunchhelper.cpp:178
GlobalVariables::JoyButton::IDLEMOUSEREFRESHRATE
static int IDLEMOUSEREFRESHRATE
Definition: globalvariables.h:32
JoyButton::setWeightModifier
static void setWeightModifier(double modifier, double maxWeightModifier, double &weightModifier)
Set the weight modifier to use for mouse smoothing.
Definition: joybutton.cpp:4231
GlobalVariables::AntimicroSettings::defaultSDLGamepadPollRate
static const int defaultSDLGamepadPollRate
Definition: globalvariables.h:98
JoyButton::setSpringModeScreen
static void setSpringModeScreen(int screen, int &springModeScreen)
Definition: joybutton.cpp:4497
GlobalVariables::JoyButton::MAXIMUMMOUSEHISTORYSIZE
static const int MAXIMUMMOUSEHISTORYSIZE
Definition: globalvariables.h:79
WinExtras::disablePointerPrecision
static void disablePointerPrecision()
Temporarily disable "Enhanced Pointer Precision".
Definition: winextras.cpp:394
AppLaunchHelper::changeGamepadPollRate
void changeGamepadPollRate()
Definition: applaunchhelper.cpp:96
JoyButton::setGamepadRefreshRate
static void setGamepadRefreshRate(int refresh, int &gamepadRefreshRate, JoyButtonMouseHelper *mouseHelper)
Set the gamepad poll rate to be used in the application.
Definition: joybutton.cpp:4295
antimicrosettings.h
JoyButton::getTestOldMouseTime
static QElapsedTimer * getTestOldMouseTime()
Definition: joybutton.cpp:4211
GlobalVariables::JoyButton::weightModifier
static double weightModifier
Definition: globalvariables.h:44
AppLaunchHelper::changeMouseRefreshRate
void changeMouseRefreshRate()
Definition: applaunchhelper.cpp:82