diff options
Diffstat (limited to 'src/input_common/mouse/mouse_input.h')
| -rw-r--r-- | src/input_common/mouse/mouse_input.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/input_common/mouse/mouse_input.h b/src/input_common/mouse/mouse_input.h index 46aa676c1..750d9b011 100644 --- a/src/input_common/mouse/mouse_input.h +++ b/src/input_common/mouse/mouse_input.h | |||
| @@ -18,10 +18,12 @@ namespace MouseInput { | |||
| 18 | 18 | ||
| 19 | enum class MouseButton { | 19 | enum class MouseButton { |
| 20 | Left, | 20 | Left, |
| 21 | Wheel, | ||
| 22 | Right, | 21 | Right, |
| 23 | Forward, | 22 | Wheel, |
| 24 | Backward, | 23 | Backward, |
| 24 | Forward, | ||
| 25 | Task, | ||
| 26 | Extra, | ||
| 25 | Undefined, | 27 | Undefined, |
| 26 | }; | 28 | }; |
| 27 | 29 | ||
| @@ -51,7 +53,7 @@ public: | |||
| 51 | * @param y the y-coordinate of the cursor | 53 | * @param y the y-coordinate of the cursor |
| 52 | * @param button_ the button pressed | 54 | * @param button_ the button pressed |
| 53 | */ | 55 | */ |
| 54 | void PressButton(int x, int y, int button_); | 56 | void PressButton(int x, int y, MouseButton button_); |
| 55 | 57 | ||
| 56 | /** | 58 | /** |
| 57 | * Signals that mouse has moved. | 59 | * Signals that mouse has moved. |
| @@ -65,7 +67,10 @@ public: | |||
| 65 | /** | 67 | /** |
| 66 | * Signals that a motion sensor tilt has ended. | 68 | * Signals that a motion sensor tilt has ended. |
| 67 | */ | 69 | */ |
| 68 | void ReleaseButton(int button_); | 70 | void ReleaseButton(MouseButton button_); |
| 71 | |||
| 72 | [[nodiscard]] bool ToggleButton(std::size_t button_); | ||
| 73 | [[nodiscard]] bool UnlockButton(std::size_t button_); | ||
| 69 | 74 | ||
| 70 | [[nodiscard]] Common::SPSCQueue<MouseStatus>& GetMouseQueue(); | 75 | [[nodiscard]] Common::SPSCQueue<MouseStatus>& GetMouseQueue(); |
| 71 | [[nodiscard]] const Common::SPSCQueue<MouseStatus>& GetMouseQueue() const; | 76 | [[nodiscard]] const Common::SPSCQueue<MouseStatus>& GetMouseQueue() const; |
| @@ -92,9 +97,11 @@ private: | |||
| 92 | }; | 97 | }; |
| 93 | 98 | ||
| 94 | u16 buttons{}; | 99 | u16 buttons{}; |
| 100 | u16 toggle_buttons{}; | ||
| 101 | u16 lock_buttons{}; | ||
| 95 | std::thread update_thread; | 102 | std::thread update_thread; |
| 96 | MouseButton last_button{MouseButton::Undefined}; | 103 | MouseButton last_button{MouseButton::Undefined}; |
| 97 | std::array<MouseInfo, 5> mouse_info; | 104 | std::array<MouseInfo, 7> mouse_info; |
| 98 | Common::SPSCQueue<MouseStatus> mouse_queue; | 105 | Common::SPSCQueue<MouseStatus> mouse_queue; |
| 99 | bool configuring{false}; | 106 | bool configuring{false}; |
| 100 | bool update_thread_running{true}; | 107 | bool update_thread_running{true}; |