summaryrefslogtreecommitdiffstats
path: root/src/input_common/main.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/input_common/main.h')
-rw-r--r--src/input_common/main.h68
1 files changed, 62 insertions, 6 deletions
diff --git a/src/input_common/main.h b/src/input_common/main.h
index 58e5dc250..5d6f26385 100644
--- a/src/input_common/main.h
+++ b/src/input_common/main.h
@@ -21,10 +21,18 @@ namespace Settings::NativeButton {
enum Values : int;
}
+namespace Settings::NativeMotion {
+enum Values : int;
+}
+
+namespace MouseInput {
+class Mouse;
+}
+
namespace InputCommon {
namespace Polling {
-enum class DeviceType { Button, AnalogPreferred };
+enum class DeviceType { Button, AnalogPreferred, Motion };
/**
* A class that can be used to get inputs from an input device like controllers without having to
@@ -50,8 +58,13 @@ public:
class GCAnalogFactory;
class GCButtonFactory;
+class UDPMotionFactory;
+class UDPTouchFactory;
+class MouseButtonFactory;
+class MouseAnalogFactory;
+class MouseMotionFactory;
+class MouseTouchFactory;
class Keyboard;
-class MotionEmu;
/**
* Given a ParamPackage for a Device returned from `GetInputDevices`, attempt to get the default
@@ -59,6 +72,7 @@ class MotionEmu;
*/
using AnalogMapping = std::unordered_map<Settings::NativeAnalog::Values, Common::ParamPackage>;
using ButtonMapping = std::unordered_map<Settings::NativeButton::Values, Common::ParamPackage>;
+using MotionMapping = std::unordered_map<Settings::NativeMotion::Values, Common::ParamPackage>;
class InputSubsystem {
public:
@@ -83,11 +97,11 @@ public:
/// Retrieves the underlying keyboard device.
[[nodiscard]] const Keyboard* GetKeyboard() const;
- /// Retrieves the underlying motion emulation factory.
- [[nodiscard]] MotionEmu* GetMotionEmu();
+ /// Retrieves the underlying mouse device.
+ [[nodiscard]] MouseInput::Mouse* GetMouse();
- /// Retrieves the underlying motion emulation factory.
- [[nodiscard]] const MotionEmu* GetMotionEmu() const;
+ /// Retrieves the underlying mouse device.
+ [[nodiscard]] const MouseInput::Mouse* GetMouse() const;
/**
* Returns all available input devices that this Factory can create a new device with.
@@ -103,6 +117,9 @@ public:
/// Retrieves the button mappings for the given device.
[[nodiscard]] ButtonMapping GetButtonMappingForDevice(const Common::ParamPackage& device) const;
+ /// Retrieves the motion mappings for the given device.
+ [[nodiscard]] MotionMapping GetMotionMappingForDevice(const Common::ParamPackage& device) const;
+
/// Retrieves the underlying GameCube analog handler.
[[nodiscard]] GCAnalogFactory* GetGCAnalogs();
@@ -115,6 +132,45 @@ public:
/// Retrieves the underlying GameCube button handler.
[[nodiscard]] const GCButtonFactory* GetGCButtons() const;
+ /// Retrieves the underlying udp motion handler.
+ [[nodiscard]] UDPMotionFactory* GetUDPMotions();
+
+ /// Retrieves the underlying udp motion handler.
+ [[nodiscard]] const UDPMotionFactory* GetUDPMotions() const;
+
+ /// Retrieves the underlying udp touch handler.
+ [[nodiscard]] UDPTouchFactory* GetUDPTouch();
+
+ /// Retrieves the underlying udp touch handler.
+ [[nodiscard]] const UDPTouchFactory* GetUDPTouch() const;
+
+ /// Retrieves the underlying GameCube button handler.
+ [[nodiscard]] MouseButtonFactory* GetMouseButtons();
+
+ /// Retrieves the underlying GameCube button handler.
+ [[nodiscard]] const MouseButtonFactory* GetMouseButtons() const;
+
+ /// Retrieves the underlying udp touch handler.
+ [[nodiscard]] MouseAnalogFactory* GetMouseAnalogs();
+
+ /// Retrieves the underlying udp touch handler.
+ [[nodiscard]] const MouseAnalogFactory* GetMouseAnalogs() const;
+
+ /// Retrieves the underlying udp motion handler.
+ [[nodiscard]] MouseMotionFactory* GetMouseMotions();
+
+ /// Retrieves the underlying udp motion handler.
+ [[nodiscard]] const MouseMotionFactory* GetMouseMotions() const;
+
+ /// Retrieves the underlying udp touch handler.
+ [[nodiscard]] MouseTouchFactory* GetMouseTouch();
+
+ /// Retrieves the underlying udp touch handler.
+ [[nodiscard]] const MouseTouchFactory* GetMouseTouch() const;
+
+ /// Reloads the input devices
+ void ReloadInputDevices();
+
/// Get all DevicePoller from all backends for a specific device type
[[nodiscard]] std::vector<std::unique_ptr<Polling::DevicePoller>> GetPollers(
Polling::DeviceType type) const;