Skip to content

Commit

Permalink
Add gaze scroll speed adjustment (talonhub#1725)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andreas Arvidsson <[email protected]>
  • Loading branch information
3 people authored Feb 8, 2025
1 parent 528b1b8 commit 62c5e74
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
12 changes: 11 additions & 1 deletion plugin/mouse/mouse_scroll.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
desc="When adjusting the continuous scrolling speed through voice commands, the result is that the speed is multiplied by the dictated number divided by this number.",
)

mod.setting(
"mouse_gaze_scroll_speed_multiplier",
type=float,
default=1.0,
desc="This multiplies the gaze scroll speed",
)

mod.tag(
"continuous_scrolling",
desc="Allows commands for adjusting continuous scrolling behavior",
Expand Down Expand Up @@ -260,7 +267,10 @@ def scroll_gaze_helper():

rect = window.rect
midpoint = rect.center.y
amount = ((y - midpoint) / (rect.height / 10)) ** 3
factor = continuous_scrolling_speed_factor * settings.get(
"user.mouse_gaze_scroll_speed_multiplier"
)
amount = factor * (((y - midpoint) / (rect.height / 10)) ** 3)
actions.mouse_scroll(amount)


Expand Down
5 changes: 4 additions & 1 deletion settings.talon
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ settings():
# Uncomment to always sort help contexts alphabetically.
# user.help_sort_contexts_by_specificity = false

# Set the scroll amount for continuous scroll/gaze scroll
# Set the scroll amount for continuous scroll
user.mouse_continuous_scroll_amount = 8

# Set the scroll multiplier for gaze scroll
user.mouse_gaze_scroll_speed_multiplier = 1.0

# Set the maximum acceleration factor when scrolling continuously. 1=constant speed/no acceleration.
user.mouse_continuous_scroll_acceleration = 1

Expand Down

0 comments on commit 62c5e74

Please sign in to comment.