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 amouse_cursor_commands_enabletag, which enables the commands defined inmouse_cursor.talon. It uses the Windows registry to replace the default cursor with a hidden cursor image. It also definesmouse_cursor_showandmouse_cursor_hideactions.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, andtrackingfiles.
mouse.py: This file defines actions for controlling mouse behavior and settings for mouse functionality:mouse_waketo enable control mouse, zoom mouse and hide the cursor (conditionally based onmouse_wake_hides_cursorsetting)mouse_sleepto disable control and zoom mouse and show the cursor.mouse_dragandmouse_drag_endfor starting and stopping drags.mouse_drag_togglefor toggling drags.copy_mouse_positionfor copying the current mouse position to the clipboard.mouse_move_center_active_windowto move the cursor to the center of the active window.noise_trigger_popwhich handles pop noises to trigger clicks or stop drags/scrolls. It respects themouse_enable_pop_click,mouse_enable_pop_stops_scroll, andmouse_enable_pop_stops_dragsettings.
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, andmouse_scroll_rightfor discrete scrolling.mouse_scroll_up_continuous,mouse_scroll_down_continuousandmouse_gaze_scrollfor continuous scrolling.mouse_scroll_stopfor stopping continuous scrolling.hiss_scroll_upandhiss_scroll_downfor changing the direction of scroll on a hiss.- A GUI is created to display the current scroll mode.
noise_trigger_hissis triggered on a hiss.- It interacts with the
trackingmodule 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 theuser.mouse_cursor_commands_enabletag defined inmouse_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.