Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugin/mouse/mouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@ def noise_trigger_pop():
)

if should_click:
ctrl.mouse_click(button=0, hold=16000)
actions.mouse_click()
23 changes: 23 additions & 0 deletions plugin/mouse/mouse_click_with_hold.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from talon import Context, Module, actions, ctrl

mod = Module()

mod.setting(
"mouse_click_hold",
type=int,
default=0,
desc="Duration to hold mouse clicks in milliseconds",
)

ctx = Context()


@ctx.action_class("main")
class MainActions:
def mouse_click(button: int = 0):
Comment thread
AndreasArvidsson marked this conversation as resolved.
hold_duration = actions.settings.get("user.mouse_click_hold")
Comment thread
AndreasArvidsson marked this conversation as resolved.
Outdated

if hold_duration < 1:
actions.next(button)
else:
ctrl.mouse_click(button=button, hold=hold_duration * 1000)
5 changes: 5 additions & 0 deletions settings.talon
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ settings():
# Set the amount to scroll left/right
user.mouse_wheel_horizontal_amount = 40

# Set the duration to hold mouse clicks in milliseconds. 0 means no hold.
# In some full screen applications, particular games, mouse clicks may not be recognized unless held for a short duration.
# Recommended value for such cases is to try with 16 ms.
user.mouse_click_hold = 0

# If `true`, start mouse grid numbering on the bottom left (vs. top left)
user.grids_put_one_bottom_left = true

Expand Down