summaryrefslogtreecommitdiffstats
path: root/src/input_common
diff options
context:
space:
mode:
Diffstat (limited to 'src/input_common')
-rwxr-xr-xsrc/input_common/analog_from_button.cpp4
-rw-r--r--src/input_common/gcadapter/gc_poller.cpp10
-rw-r--r--src/input_common/mouse/mouse_poller.cpp10
-rw-r--r--src/input_common/sdl/sdl_impl.cpp10
-rw-r--r--src/input_common/udp/client.cpp4
-rw-r--r--src/input_common/udp/client.h3
-rw-r--r--src/input_common/udp/udp.cpp4
7 files changed, 43 insertions, 2 deletions
diff --git a/src/input_common/analog_from_button.cpp b/src/input_common/analog_from_button.cpp
index 07a0fa4a1..770893687 100755
--- a/src/input_common/analog_from_button.cpp
+++ b/src/input_common/analog_from_button.cpp
@@ -139,6 +139,10 @@ public:
static_cast<float>(y) * coef * (x == 0 ? 1.0f : SQRT_HALF));
}
+ Input::AnalogProperties GetAnalogProperties() const override {
+ return {modifier_scale, 1.0f, 0.5f};
+ }
+
bool GetAnalogDirectionStatus(Input::AnalogDirection direction) const override {
switch (direction) {
case Input::AnalogDirection::RIGHT:
diff --git a/src/input_common/gcadapter/gc_poller.cpp b/src/input_common/gcadapter/gc_poller.cpp
index 9670bdeb2..1b6ded8d6 100644
--- a/src/input_common/gcadapter/gc_poller.cpp
+++ b/src/input_common/gcadapter/gc_poller.cpp
@@ -185,6 +185,16 @@ public:
return {0.0f, 0.0f};
}
+ std::tuple<float, float> GetRawStatus() const override {
+ const float x = GetAxis(axis_x);
+ const float y = GetAxis(axis_y);
+ return {x, y};
+ }
+
+ Input::AnalogProperties GetAnalogProperties() const override {
+ return {deadzone, range, 0.5f};
+ }
+
bool GetAnalogDirectionStatus(Input::AnalogDirection direction) const override {
const auto [x, y] = GetStatus();
const float directional_deadzone = 0.5f;
diff --git a/src/input_common/mouse/mouse_poller.cpp b/src/input_common/mouse/mouse_poller.cpp
index 3d0dd7fc8..bb56787ee 100644
--- a/src/input_common/mouse/mouse_poller.cpp
+++ b/src/input_common/mouse/mouse_poller.cpp
@@ -107,6 +107,16 @@ public:
return {0.0f, 0.0f};
}
+ std::tuple<float, float> GetRawStatus() const override {
+ const float x = GetAxis(axis_x);
+ const float y = GetAxis(axis_y);
+ return {x, y};
+ }
+
+ Input::AnalogProperties GetAnalogProperties() const override {
+ return {deadzone, range, 0.5f};
+ }
+
private:
const u32 button;
const u32 axis_x;
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp
index 1b5750937..f67de37e3 100644
--- a/src/input_common/sdl/sdl_impl.cpp
+++ b/src/input_common/sdl/sdl_impl.cpp
@@ -377,6 +377,16 @@ public:
return {};
}
+ std::tuple<float, float> GetRawStatus() const override {
+ const float x = joystick->GetAxis(axis_x, range);
+ const float y = joystick->GetAxis(axis_y, range);
+ return {x, -y};
+ }
+
+ Input::AnalogProperties GetAnalogProperties() const override {
+ return {deadzone, range, 0.5f};
+ }
+
bool GetAnalogDirectionStatus(Input::AnalogDirection direction) const override {
const auto [x, y] = GetStatus();
const float directional_deadzone = 0.5f;
diff --git a/src/input_common/udp/client.cpp b/src/input_common/udp/client.cpp
index e7e50d789..c4afa4174 100644
--- a/src/input_common/udp/client.cpp
+++ b/src/input_common/udp/client.cpp
@@ -144,6 +144,10 @@ Client::~Client() {
Reset();
}
+Client::ClientData::ClientData() = default;
+
+Client::ClientData::~ClientData() = default;
+
std::vector<Common::ParamPackage> Client::GetInputDevices() const {
std::vector<Common::ParamPackage> devices;
for (std::size_t client = 0; client < clients.size(); client++) {
diff --git a/src/input_common/udp/client.h b/src/input_common/udp/client.h
index 822f9c550..a523f6124 100644
--- a/src/input_common/udp/client.h
+++ b/src/input_common/udp/client.h
@@ -98,6 +98,9 @@ public:
private:
struct ClientData {
+ ClientData();
+ ~ClientData();
+
std::string host{"127.0.0.1"};
u16 port{26760};
std::size_t pad_index{};
diff --git a/src/input_common/udp/udp.cpp b/src/input_common/udp/udp.cpp
index b630281a0..9829da6f0 100644
--- a/src/input_common/udp/udp.cpp
+++ b/src/input_common/udp/udp.cpp
@@ -84,8 +84,8 @@ public:
private:
const std::string ip;
- const u16 port;
- const u16 pad;
+ [[maybe_unused]] const u16 port;
+ [[maybe_unused]] const u16 pad;
CemuhookUDP::Client* client;
mutable std::mutex mutex;
};