Skip to content

mouse

The community/plugin/mouse directory contains files for controlling the mouse cursor and scrolling behavior within Talon. It provides functionalities such as hiding/showing the cursor, simulating mouse clicks, dragging, and scrolling, as well as integrating with eye-tracking for gaze-based scrolling.

Here's a breakdown of the key files and their roles:

  • mouse_cursor.py: This file is responsible for hiding and showing the mouse cursor, particularly on Windows. It defines a mouse_cursor_commands_enable tag, which enables the commands defined in mouse_cursor.talon. It uses the Windows registry to replace the default cursor with a hidden cursor image. It also defines mouse_cursor_show and mouse_cursor_hide actions.
  • mouse.talon: This Talon file defines voice commands for various mouse actions, including:
    • Toggling control mouse, zoom mouse, and camera overlay modes.
    • Simulating left, right, and middle mouse clicks.
    • Performing single, double, and triple clicks.
    • Initiating and ending mouse drags.
    • Scrolling the mouse wheel up, down, left, and right.
    • Copying the current mouse position.
    • It also includes deprecated commands.
    • It interacts with the mouse.py, mouse_scroll.py, and tracking files.
  • mouse.py: This file defines actions for controlling mouse behavior and settings for mouse functionality:
    • mouse_wake to enable control mouse, zoom mouse and hide the cursor (conditionally based on mouse_wake_hides_cursor setting)
    • mouse_sleep to disable control and zoom mouse and show the cursor.
    • mouse_drag and mouse_drag_end for starting and stopping drags.
    • mouse_drag_toggle for toggling drags.
    • copy_mouse_position for copying the current mouse position to the clipboard.
    • mouse_move_center_active_window to move the cursor to the center of the active window.
    • noise_trigger_pop which handles pop noises to trigger clicks or stop drags/scrolls. It respects the mouse_enable_pop_click, mouse_enable_pop_stops_scroll, and mouse_enable_pop_stops_drag settings.
  • mouse_scroll.py: This file handles mouse wheel scrolling and defines actions for scrolling up, down, left, and right. It also provides continuous scroll functionalities and gaze based scrolling:
    • mouse_scroll_up, mouse_scroll_down, mouse_scroll_left, and mouse_scroll_right for discrete scrolling.
    • mouse_scroll_up_continuous, mouse_scroll_down_continuous and mouse_gaze_scroll for continuous scrolling.
    • mouse_scroll_stop for stopping continuous scrolling.
    • hiss_scroll_up and hiss_scroll_down for changing the direction of scroll on a hiss.
    • A GUI is created to display the current scroll mode.
    • noise_trigger_hiss is triggered on a hiss.
    • It interacts with the tracking module to toggle the control mouse.
    • It defines settings for wheel amounts, continuous scroll amounts, and acceleration factors.
  • mouse_cursor.talon: This file defines voice commands for showing or hiding the mouse cursor and is enabled by the user.mouse_cursor_commands_enable tag defined in mouse_cursor.py.

These files work together to provide a comprehensive set of mouse control features. The mouse.talon file provides the voice interface, calling functions from mouse.py and mouse_scroll.py, which in turn interact with the operating system via Talon's built-in actions and ctrl. The mouse_cursor.py and mouse_cursor.talon files provide functions for hiding and showing the cursor on Windows.

The mouse.py file also contains settings that customize the behavior of the scripts, such as enabling pop clicks, stopping scroll, and stopping drag. The mouse_scroll.py provides settings for the scroll wheel amount, continuous scrolling amounts, and the acceleration factor.