diff options
Diffstat (limited to '')
-rw-r--r-- | src/input_common/mouse/mouse_input.h | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/input_common/mouse/mouse_input.h b/src/input_common/mouse/mouse_input.h index 58803c1bf..750d9b011 100644 --- a/src/input_common/mouse/mouse_input.h +++ b/src/input_common/mouse/mouse_input.h @@ -18,10 +18,12 @@ namespace MouseInput { enum class MouseButton { Left, - Wheel, Right, - Forward, + Wheel, Backward, + Forward, + Task, + Extra, Undefined, }; @@ -51,19 +53,24 @@ public: * @param y the y-coordinate of the cursor * @param button_ the button pressed */ - void PressButton(int x, int y, int button_); + void PressButton(int x, int y, MouseButton button_); /** * Signals that mouse has moved. * @param x the x-coordinate of the cursor * @param y the y-coordinate of the cursor + * @param center_x the x-coordinate of the middle of the screen + * @param center_y the y-coordinate of the middle of the screen */ - void MouseMove(int x, int y); + void MouseMove(int x, int y, int center_x, int center_y); /** * Signals that a motion sensor tilt has ended. */ - void ReleaseButton(int button_); + void ReleaseButton(MouseButton button_); + + [[nodiscard]] bool ToggleButton(std::size_t button_); + [[nodiscard]] bool UnlockButton(std::size_t button_); [[nodiscard]] Common::SPSCQueue<MouseStatus>& GetMouseQueue(); [[nodiscard]] const Common::SPSCQueue<MouseStatus>& GetMouseQueue() const; @@ -74,11 +81,13 @@ public: private: void UpdateThread(); void UpdateYuzuSettings(); + void StopPanning(); struct MouseInfo { InputCommon::MotionInput motion{0.0f, 0.0f, 0.0f}; Common::Vec2<int> mouse_origin; Common::Vec2<int> last_mouse_position; + Common::Vec2<float> last_mouse_change; bool is_tilting = false; float sensitivity{0.120f}; @@ -88,11 +97,14 @@ private: }; u16 buttons{}; + u16 toggle_buttons{}; + u16 lock_buttons{}; std::thread update_thread; MouseButton last_button{MouseButton::Undefined}; - std::array<MouseInfo, 5> mouse_info; + std::array<MouseInfo, 7> mouse_info; Common::SPSCQueue<MouseStatus> mouse_queue; bool configuring{false}; bool update_thread_running{true}; + int mouse_panning_timout{}; }; } // namespace MouseInput |