ChromeOS Disable internal touchpad
To prevent accidental clicks and improve the experience for external mouse users, ChromeOS allows you to disable the built-in touchpad. This accessibility feature offers options for always-off or disabling the touchpad only when a mouse is connected.
Summary
User flow
ChromeOS allows users to disable the built-in touchpad through the accessibility settings. Here's the user flow:
Navigate to Settings: Go to Accessibility > Cursor and touchpad > Disable internal touchpad.
Choose a mode: Select one of the following options:
- Never: The touchpad is always enabled.
- Always: The touchpad is always disabled.
- When a mouse is connected: The touchpad is disabled only when an external mouse is connected.
- Confirmation (Applies when mode is “Always” or “When a mouse is connected”): The internal touchpad is disabled when the confirmation dialog is shown. This ensures you don‘t accidentally disable the touchpad without an alternative input method (keyboard or mouse). If the dialog isn’t confirmed or canceled before the 30 second timeout the touchpad will be re-enabled.
- Once confirmed, a notification appears in the bottom right corner indicating the touchpad is disabled. You can re-enable the touchpad directly from this notification.
Device Page: The touchpad's status (enabled/disabled) is also reflected in the Devices page.
“When a mouse is connected” mode specifics:
- The confirmation dialog appears only the first time an external mouse is connected after enabling this mode.
Technical Overview
The internal touchpad disabling feature in ChromeOS is implemented using Event Rewriters. Event Rewriters intercept and modify event streams, allowing the system to selectively block touchpad input.
Key Components:
- DisableTouchpadEventRewriter:
- Determines the source of mouse events (internal touchpad or external mouse).
- Detects the presence of a connected external mouse.
- Disables mouse events from the internal touchpad based on the configured mode and mouse connection status.
- Includes a mechanism (e.g. pressing the Shift key 5 times) to re-enable the touchpad.
- Disable Touchpad Dropdown:
- Provides the user interface for selecting the touchpad disabling mode.
- Displays instructions to the user on how to re-enable the touchpad (e.g. by pressing the Shift key 5 times).
- Devices Page:
- This page displays the current status of the touchpad (enabled or disabled), providing visual feedback to the user.
- AccessibilityController:
- Manages the display of confirmation dialogs and notifications to the user.
- Monitors user preferences for touchpad disabling mode and informs the DisableTouchpadEventRewriter.
Testing
Settings Tests: Verify that user selections in the “Cursor and touchpad” settings page correctly update the underlying preferences.
DisableTouchpadEventRewriter Tests: Validate the core logic of the DisableTouchpadEventRewriter, ensuring it correctly disables and enables the touchpad based on different scenarios (mode selection, mouse connection status, etc.).
AccessibilityController Tests: Confirm that the AccessibilityController correctly manages the display of confirmation dialogs and notifications to the user.