34#include <NDEVR/INIInterface.h>
35#include <NDEVR/Vector.h>
36#include <NDEVR/RGBColor.h>
38class QPropertyAnimation;
76 Q_PROPERTY(
float snap_back_percent READ snapBackPercent WRITE setSnapBackPercent)
79 explicit Joystick(QWidget* parent =
nullptr);
83 fltp04 outerRadius()
const;
84 QSize sizeHint()
const override;
88 void setSnapBackPercent(
float snap_percent);
89 virtual void mousePressEvent(QMouseEvent* ev)
override;
90 virtual void mouseMoveEvent(QMouseEvent* ev)
override;
91 virtual void mouseReleaseEvent(QMouseEvent* ev)
override;
92 void addButton(
Button* button);
93 bool event(QEvent* event)
override;
94 void setDeadzone(
fltp08 deadzone);
95 void setJoystickSettingsName(
const String& name);
98 bool isDragging()
const;
100 void setDrawDeadzone(
bool draw_deadzone);
101 void setDrawSensitivity(
bool draw_sense);
108 void showSettings(
const PopupInfo& info);
109 void updateButton(
uint04 button);
110 void updateButtons();
112 void resizeEvent(QResizeEvent* event)
override;
113 void paintEvent(QPaintEvent* paint_event)
override;
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition INIReader.h:57
Definition INIInterface.h:40
Vector< 2, fltp04 > m_joystick_draw_location
Definition Joystick.h:124
float snapBackPercent() const
Definition Joystick.h:87
RGBColor m_inner_color
Definition Joystick.h:120
bool m_is_pressing
Definition Joystick.h:129
bool m_dragging
Definition Joystick.h:128
fltp04 m_inner_radius
Definition Joystick.h:118
Button * m_settings_button
Definition Joystick.h:116
QPropertyAnimation * m_joystick_release_animation
Definition Joystick.h:126
void joystickLocationChangedSignal(const Vector< 2, fltp04 > &location)
Vector< 2, fltp04 > m_location
Definition Joystick.h:117
fltp04 m_knob_radius
Definition Joystick.h:127
JoystickSettings m_settings
Definition Joystick.h:115
bool m_draw_sensitivity
Definition Joystick.h:131
void joystickButtonReleasedSignal(const Vector< 2, fltp04 > &location)
Buffer< Button * > m_custom_buttons
Definition Joystick.h:121
RGBColor m_knob_inner_color
Definition Joystick.h:122
RGBColor m_knob_outer_color
Definition Joystick.h:123
bool m_draw_deadzone
Definition Joystick.h:130
void joystickButtonPressedSignal(const Vector< 2, fltp04 > &location)
RGBColor m_outer_color
Definition Joystick.h:119
const JoystickSettings & settings() const
Definition Joystick.h:96
fltp04 deadzone
Definition Joystick.h:55
void getINI(INIFactory &factory) override
Definition Joystick.cpp:582
SensitivityMode sensitivity_mode
Definition Joystick.h:56
SensitivityMode
Definition Joystick.h:50
@ e_exponential
Definition Joystick.h:52
@ e_linear
Definition Joystick.h:51
@ e_sinusoidal
Definition Joystick.h:53
bool operator==(const JoystickSettings &settings) const
Definition Joystick.h:60
fltp04 sensitivity
Definition Joystick.h:57
bool uses_knob
Definition Joystick.h:59
bool uses_buttons
Definition Joystick.h:58
JoystickSettings()
Definition Joystick.cpp:569
void resetToDefaults()
Definition Joystick.cpp:574
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:53
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
float fltp04
Defines an alias representing a 4 byte floating-point number.
Definition BaseValues.hpp:157
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:181