From ab88c2f6112edba35bfa91ee8864e760728d16e8 Mon Sep 17 00:00:00 2001 From: german Date: Fri, 10 Jul 2020 21:20:50 -0500 Subject: First implementation of controller rumble --- src/core/frontend/input.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/core/frontend/input.h') diff --git a/src/core/frontend/input.h b/src/core/frontend/input.h index 9da0d2829..277b70e53 100644 --- a/src/core/frontend/input.h +++ b/src/core/frontend/input.h @@ -33,6 +33,9 @@ public: virtual bool GetAnalogDirectionStatus(AnalogDirection direction) const { return {}; } + virtual bool SetRumblePlay(f32 amp_high, f32 amp_low, f32 freq_high, f32 freq_low) const { + return {}; + } }; /// An abstract class template for a factory that can create input devices. -- cgit v1.2.3 From 9b501af8e3d0f6457fafb0fdfbcc11f6da4f0e8a Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Sat, 10 Oct 2020 09:03:47 -0400 Subject: controllers/npad: Add heuristics to reduce rumble state changes Sending too many state changes in a short period of time can cause massive performance issues. As a result, we have to use several heuristics to reduce the number of state changes to minimize/eliminate this performance impact while maintaining the quality of these vibrations as much as possible. --- src/core/frontend/input.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/frontend/input.h') diff --git a/src/core/frontend/input.h b/src/core/frontend/input.h index 277b70e53..fb2ce2514 100644 --- a/src/core/frontend/input.h +++ b/src/core/frontend/input.h @@ -33,7 +33,7 @@ public: virtual bool GetAnalogDirectionStatus(AnalogDirection direction) const { return {}; } - virtual bool SetRumblePlay(f32 amp_high, f32 amp_low, f32 freq_high, f32 freq_low) const { + virtual bool SetRumblePlay(f32 amp_low, f32 freq_low, f32 amp_high, f32 freq_high) const { return {}; } }; -- cgit v1.2.3 From e9e1876e821b8bd1bb5c8254ec93e2cc479e16dd Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Tue, 20 Oct 2020 13:55:25 -0400 Subject: input_common: Add VibrationDevice and VibrationDeviceFactory A vibration device is an input device that returns an unsigned byte as status. It represents whether the vibration device supports vibration or not. If the status returns 1, it supports vibration. Otherwise, it does not support vibration. --- src/core/frontend/input.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/core/frontend/input.h') diff --git a/src/core/frontend/input.h b/src/core/frontend/input.h index fb2ce2514..25ac5af46 100644 --- a/src/core/frontend/input.h +++ b/src/core/frontend/input.h @@ -121,6 +121,13 @@ using ButtonDevice = InputDevice; */ using AnalogDevice = InputDevice>; +/** + * A vibration device is an input device that returns an unsigned byte as status. + * It represents whether the vibration device supports vibration or not. + * If the status returns 1, it supports vibration. Otherwise, it does not support vibration. + */ +using VibrationDevice = InputDevice; + /** * A motion status is an object that returns a tuple of accelerometer state vector, * gyroscope state vector, rotation state vector and orientation state matrix. -- cgit v1.2.3 From 5c4774e8ce1d3c5391402f4b2244cfb4dfe7d57a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 15 Nov 2020 06:22:01 -0500 Subject: input_common: Treat warnings as errors Migrates over warnings as errors for input common to match how the common library treats warnings as errors. --- src/core/frontend/input.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/frontend/input.h') diff --git a/src/core/frontend/input.h b/src/core/frontend/input.h index 25ac5af46..95c2848eb 100644 --- a/src/core/frontend/input.h +++ b/src/core/frontend/input.h @@ -30,7 +30,7 @@ public: virtual StatusType GetStatus() const { return {}; } - virtual bool GetAnalogDirectionStatus(AnalogDirection direction) const { + virtual bool GetAnalogDirectionStatus([[maybe_unused]] AnalogDirection direction) const { return {}; } virtual bool SetRumblePlay(f32 amp_low, f32 freq_low, f32 amp_high, f32 freq_high) const { -- cgit v1.2.3 From d04abd39eb3dd5333cbd84e2bb6ad7e4f438de34 Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 23 Nov 2020 18:11:21 -0800 Subject: Fix warnings in core/frontend/input.h with [[maybe_unused]] Fixes build break due to #4927 --- src/core/frontend/input.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/core/frontend/input.h') diff --git a/src/core/frontend/input.h b/src/core/frontend/input.h index 95c2848eb..11c2e96ca 100644 --- a/src/core/frontend/input.h +++ b/src/core/frontend/input.h @@ -33,7 +33,9 @@ public: virtual bool GetAnalogDirectionStatus([[maybe_unused]] AnalogDirection direction) const { return {}; } - virtual bool SetRumblePlay(f32 amp_low, f32 freq_low, f32 amp_high, f32 freq_high) const { + virtual bool SetRumblePlay([[maybe_unused]] f32 amp_low, [[maybe_unused]] f32 freq_low, + [[maybe_unused]] f32 amp_high, + [[maybe_unused]] f32 freq_high) const { return {}; } }; -- cgit v1.2.3 From e46f0e084c73420f8c76c514079952ca0acf1ebe Mon Sep 17 00:00:00 2001 From: german Date: Tue, 17 Nov 2020 22:55:09 -0600 Subject: Implement full mouse support --- src/core/frontend/input.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/core/frontend/input.h') diff --git a/src/core/frontend/input.h b/src/core/frontend/input.h index 25ac5af46..93251e3aa 100644 --- a/src/core/frontend/input.h +++ b/src/core/frontend/input.h @@ -161,10 +161,15 @@ using MotionStatus = std::tuple, Common::Vec3, Common using MotionDevice = InputDevice; /** - * A touch device is an input device that returns a tuple of two floats and a bool. The floats are + * A touch status is an object that returns a tuple of two floats and a bool. The floats are * x and y coordinates in the range 0.0 - 1.0, and the bool indicates whether it is pressed. */ -using TouchDevice = InputDevice>; +using TouchStatus = std::tuple; + +/** + * A touch device is an input device that returns a touch status object + */ +using TouchDevice = InputDevice; /** * A mouse device is an input device that returns a tuple of two floats and four ints. -- cgit v1.2.3