File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,6 +51,12 @@ class Mouse {
5151 [[nodiscard]] std::expected<void , Error> press (MouseButton button);
5252 [[nodiscard]] std::expected<void , Error> release (MouseButton button);
5353
54+ // Raw button transition with an explicit click count. This is the atom used by
55+ // higher-level language bindings that compose multi-click gestures themselves.
56+ [[nodiscard]] std::expected<void , Error> button (
57+ MouseButton button, ButtonAction action, int clickCount
58+ );
59+
5460 // Press then release at the current position. X1/X2 require
5561 // supportsExtraMouseButtons or the call fails with Unsupported.
5662 [[nodiscard]] std::expected<void , Error> click (
@@ -82,4 +88,4 @@ class Mouse {
8288 backend::IMouseBackend* backend_;
8389};
8490
85- } // namespace robot
91+ } // namespace robot
Original file line number Diff line number Diff line change @@ -62,6 +62,12 @@ std::expected<void, Error> Mouse::release(const MouseButton button) {
6262 return backend_->button (button, ButtonAction::Up, 1 );
6363}
6464
65+ std::expected<void , Error> Mouse::button (
66+ const MouseButton button, const ButtonAction action, const int clickCount
67+ ) {
68+ return backend_->button (button, action, clickCount);
69+ }
70+
6571std::expected<void , Error> Mouse::click (const MouseButton button) {
6672 if (auto r = backend_->button (button, ButtonAction::Down, 1 ); !r) return r;
6773 return backend_->button (button, ButtonAction::Up, 1 );
@@ -110,4 +116,4 @@ std::expected<void, Error> Mouse::scroll(const ScrollDelta delta) {
110116 return backend_->scroll (delta);
111117}
112118
113- } // namespace robot
119+ } // namespace robot
You can’t perform that action at this time.
0 commit comments