Skip to content

Conversation

@devinprater
Copy link

This pull request introduces major accessibility improvements for the Termux terminal view, focusing on screen reader support and improved virtual key handling. The most significant changes include the addition of a custom accessibility helper for the terminal view, enhanced accessibility event handling, and improved toggling and feedback for virtual Control and Fn keys. These updates make the terminal experience much more usable for users relying on assistive technologies.

Accessibility Enhancements:

  • Added a new TerminalAccessibilityHelper class that implements ExploreByTouchHelper, enabling semantic navigation and interaction for screen readers by exposing logical text blocks (paragraphs/lines) in the terminal (terminal-view/src/main/java/com/termux/view/TerminalAccessibilityHelper.java).
  • Integrated the accessibility helper into TerminalView, registering it as the accessibility delegate and tracking screen/cursor state for accessibility announcements (terminal-view/src/main/java/com/termux/view/TerminalView.java). [1] [2]
  • Implemented a sophisticated accessibility event processor in TerminalView to announce content changes, cursor movement, and text deletions in a way that is compatible with screen readers and (usually) avoids redundant feedback (terminal-view/src/main/java/com/termux/view/TerminalView.java).
  • Modified input connection setup to provide appropriate IME types and options when accessibility is enabled, ensuring compatibility with accessibility keyboards such as Braille Keyboard (terminal-view/src/main/java/com/termux/view/TerminalView.java). [1] [2]

Virtual Key Handling Improvements:

  • Changed the logic for virtual Control and Fn keys to use toggling (on/off) with assertive accessibility announcements, ensuring users are informed of the current modifier state. This includes renaming variables for clarity and resetting state after use (app/src/main/java/com/termux/app/terminal/TermuxTerminalViewClient.java). [1] [2] [3] [4]
  • Added an assertive announcement method using AccessibilityManager to provide immediate feedback when toggling modifier keys (app/src/main/java/com/termux/app/terminal/TermuxTerminalViewClient.java).

Dependency Updates:

  • Added dependencies on androidx.core and androidx.customview to support the new accessibility features (terminal-view/build.gradle).

@devinprater
Copy link
Author

Just a note that this was vibe coded, but was checked to make sure it works well enough. Focus tracking could be better, but I can easily install packages, review output line by line, and page through info pages.

<!ENTITY TERMUX_FLOAT_APP_NAME "Termux:Float">
<!ENTITY TERMUX_STYLING_APP_NAME "Termux:Styling">
<!ENTITY TERMUX_TASKER_APP_NAME "Termux:Tasker">
<!ENTITY TERMUX_WIDGET_APP_NAME "Termux:Widget">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happened here?

@devinprater
Copy link
Author

Sorry, I was originally going to just have it be a separate app, but other people encouraged me to just submit a PR and so I reverted most of the changes. This last commit should fix that issue.

Add comprehensive accessibility support for Android screen readers
(TalkBack) to improve terminal and Extra Keys navigation for users
with visual impairments.

Terminal view accessibility:
- Add TerminalAccessibilityHelper using ExploreByTouchHelper to expose
  terminal lines as individual accessible items
- Implement line-by-line navigation with automatic hard-wrapped line
  merging for continuous paragraph reading
- Add text sanitization to remove terminal control characters and
  backslash continuation markers from announcements
- Improve accessibility focus tracking during scrolling and text updates
- Suppress redundant status bar announcements during navigation
- Differentiate between jitter events and intentional scrolling

Extra Keys accessibility:
- Add content descriptions to all Extra Keys buttons (e.g., "Up",
  "Backspace", "Control") for better screen reader announcements
- Support navigation keys (arrows, Home, End, Page Up/Down)
- Support modifier keys (Ctrl, Alt, Function)
- Support special keys (Drawer, Keyboard, Scroll, Paste)

This implementation allows screen reader users to:
- Navigate terminal output line-by-line using swipe gestures
- Read hard-wrapped lines as continuous paragraphs
- Access all Extra Keys buttons with proper labels
- Use the terminal effectively without visual feedback
@fornwall
Copy link
Member

fornwall commented Jan 4, 2026

@devinprater This is a really valuable and important effort 🙏! Will review and test it.

Could you rebase on top of the master branch, where 53f75a8 was just merged which updated the tooling (note: java 17 or later is now required)? That should fix the currently failing CI pipeline.

dependabot bot and others added 6 commits January 4, 2026 06:07
Bumps [gradle/actions](https://github.com/gradle/actions) from 4 to 5.
- [Release notes](https://github.com/gradle/actions/releases)
- [Commits](gradle/actions@v4...v5)

---
updated-dependencies:
- dependency-name: gradle/actions
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 4 to 5.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](actions/setup-java@v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Replace `gradle/wrapper-validation-action@v3` with
`gradle/actions/wrapper-validation@5` which should fix the error seen
e.g. [here](https://github.com/termux/termux-app/actions/runs/20685857619/job/59386383274):

> Error: The action gradle/actions/wrapper-validation@v3.5.0 is not allowed in termux/termux-app because all actions must be from a repository owned by termux, created by GitHub, or match one of the patterns: gradle/actions/dependency-submission@*, gradle/wrapper-validation-action@v*.
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Fredrik Fornwall <fredrik@fornwall.net>
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v4...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@devinprater
Copy link
Author

Okay, that should be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants