diff --git a/docs/rules.md b/docs/rules.md index 706a35ff..459b6ddc 100644 --- a/docs/rules.md +++ b/docs/rules.md @@ -245,7 +245,8 @@ If the previous condition in the parent rule returns a number the scroll amounts ### Mouse click A `MouseClick` action takes a mouse button name (`left`, `middle` or `right`) and a positive number or 'click', 'depress', or 'release'. The action simulates that number of clicks of the specified button or just one click, depress, or release of the button. -A `MouseClick` action takes a mouse button name (`left`, `middle` or `right`) and a positive number, and simulates that number of clicks of the specified button. + +### Execute An `Execute` action takes a program and arguments and executes it asynchronously. ### Set setting diff --git a/lib/logitech_receiver/diversion.py b/lib/logitech_receiver/diversion.py index a1b50613..5974334f 100644 --- a/lib/logitech_receiver/diversion.py +++ b/lib/logitech_receiver/diversion.py @@ -1321,17 +1321,17 @@ class MouseClick(Action): self.count = count elif warn: logger.warning( - "rule MouseClick action: argument %s should be an integer or CLICK, PRESS, or RELEASE", + "rule MouseClick action: argument %s should be an integer or click, depress, or release", count, ) self.count = 1 def __str__(self): - return f"MouseClick: {self.button} ({int(self.count)})" + return f"MouseClick: {self.button} ({str(self.count)})" def evaluate(self, feature, notification: HIDPPNotification, device, last_result): if logger.isEnabledFor(logging.INFO): - logger.info(f"MouseClick action: {int(self.count)} {self.button}") + logger.info(f"MouseClick action: {str(self.count)} {self.button}") if self.button and self.count: click(buttons[self.button], self.count) time.sleep(0.01) diff --git a/lib/solaar/ui/rule_actions.py b/lib/solaar/ui/rule_actions.py index 1878bf60..706479f9 100644 --- a/lib/solaar/ui/rule_actions.py +++ b/lib/solaar/ui/rule_actions.py @@ -214,7 +214,9 @@ class MouseClickUI(ActionUI): ) self.widgets[self.label] = (0, 0, 4, 1) self.label_b = Gtk.Label(label=_("Button"), halign=Gtk.Align.END, valign=Gtk.Align.CENTER, hexpand=True) - self.label_c = Gtk.Label(label=_("Count and Action"), halign=Gtk.Align.END, valign=Gtk.Align.CENTER, hexpand=True) + self.label_c = Gtk.Label( + label=_("Action (and Count, if click)"), halign=Gtk.Align.END, valign=Gtk.Align.CENTER, hexpand=True + ) self.field_b = CompletionEntry(self.BUTTONS) self.field_c = Gtk.SpinButton.new_with_range(self.MIN_VALUE, self.MAX_VALUE, 1) self.field_d = CompletionEntry(self.ACTIONS) @@ -227,8 +229,8 @@ class MouseClickUI(ActionUI): self.widgets[self.label_b] = (0, 1, 1, 1) self.widgets[self.field_b] = (1, 1, 1, 1) self.widgets[self.label_c] = (2, 1, 1, 1) - self.widgets[self.field_c] = (3, 1, 1, 1) - self.widgets[self.field_d] = (4, 1, 1, 1) + self.widgets[self.field_c] = (4, 1, 1, 1) + self.widgets[self.field_d] = (3, 1, 1, 1) def show(self, component, editable=True): super().show(component, editable)