Skip to content

Conversation

@nvdaes
Copy link
Collaborator

@nvdaes nvdaes commented Oct 21, 2025

  • Add ability to scroll automatically with braille
  • Add ability to scroll automatically in braille

Link to issue number:

Fixes #18573

Summary of the issue:

Users may wish to scroll braille automatically.

Description of user facing changes:

  • Added an unassigned command to toggle scrolling braille automatically.
  • Added unasigned commands to decrease and increase the autoScroll rate.
  • In the braille settings subpanel, added an edit box to set the autoScroll rate, measured in cells/seconds.

Description of developer facing changes:

The BrailleHandler class has a new method named autoScroll with an enable parameter, to toggle braille automatic -scroll.

Description of development approach:

Added an autoScroll`` method in the BrailleHandlerclass to toggle automatic scroll. This will usewx.CallLaterto call theautoScrollForwardmethod. Code has been added to stop autoScroll when the caret reaches the end of a document (the cursor is not moved), when a message is displayed in braille, when a new object is handled, on secure screens, and when the session is locked, via the_clearAll` method.
Also, if automatic scroll is enabled, when scrolling back or forward, autoScroll will be disabled and enabled to reset the timer and scroll forward again.

Testing strategy:

Tested locally.

Known issues with pull request:

None.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@codeofdusk
Copy link
Contributor

Some displays have capacitive sensors that can detect when you reach the end of the line of Braille and optionally advance automatically, so supporting this use case is also worth thinking about.

CC @FelixGruetzmacher, @LeonarddeR.

@LeonarddeR
Copy link
Collaborator

For now, the default reading speed is 10 chars/sec.

This means that the speed would be dependant on the braille display size, but that doesn't seem to be the case in your code yet. I like the assumed characters per sec approach though. That would mean you can increase scrolling speed when a line only contains a few characters.

@nvdaes
Copy link
Collaborator Author

nvdaes commented Oct 22, 2025

Leonard wrote:

I like the assumed characters per sec approach

I write the code for that approach, but later I removed it due to feedback from people who is concerned about ability to understand this concept, thinking for example in older people, or people with cognitive difficulties. Seems that the BrailleExtender add-on used the seconds approach, not chars/sec.
We may create a combo box to decide between seconds or char/sec, or adding a checkbox asking if this should be proportional to the display size or the number of cells used.
cc: @gerald-hartig since this may be controversial.

@nvdaes
Copy link
Collaborator Author

nvdaes commented Oct 23, 2025

For now I'll try to create a combo box. I thought abou using the number of used cells, not the display size, too. But perhaps this produces an uncomfortable feeling if someone doesn't know if all relevant information has been read, if interval about scrollings is variable. So a combo box is more flexible than a checkbox, to add several options if desired.
In the spanish community, where there are users testing this, a combo box has been suggested for this.

@nvdaes
Copy link
Collaborator Author

nvdaes commented Oct 25, 2025

@SaschaCowley , I think that the failure of Pyright is not related to the code. Seems that the analysis is not performed due to something related to the cache.

@nvdaes
Copy link
Collaborator Author

nvdaes commented Oct 25, 2025

Sorry @SaschaCowley , forget my comment about Pyright. I've analyzed the code locally and have fixed it (now no I don't get errors and the check here has passed).

@SaschaCowley SaschaCowley added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Oct 28, 2025
@nvdaes
Copy link
Collaborator Author

nvdaes commented Oct 29, 2025

I see that this has been labelled with ConceptApproved, so I'll continue working on this. I think that adding a combo box for cells/seconds and seconds can be confusing, since in one case the value increases the rate, and in the other one the delay is increased. So I'm thinking in adding just a value, but trying to reflect the conversion between cells/seconds to seconds deppending on the display size. I have found people who doesn't understand the concept of cells/seconds, at least the first time. But I think that it has more sense that jst seconds, since the same value can be applied regardless to the display size, for example if someone connects a different braille display.

@nvdaes nvdaes requested a review from SaschaCowley November 20, 2025 18:54
@nvdaes nvdaes marked this pull request as ready for review November 20, 2025 18:55
@nvdaes nvdaes requested review from a team as code owners November 20, 2025 18:55
@nvdaes nvdaes requested a review from Qchristensen November 20, 2025 18:55
@nvdaes
Copy link
Collaborator Author

nvdaes commented Nov 21, 2025

@seanbudd , thanks for your review. I've seen just a suggestion related to the user guide, and I've applied it.

Copy link
Member

@SaschaCowley SaschaCowley left a comment

Choose a reason for hiding this comment

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

Overall really nice, @nvdaes. A few style things, as well as some questions regarding the UX for braille-only users.

if config.conf["braille"]["autoScrollRate"] < maxRate:
config.conf["braille"]["autoScrollRate"] += 1
rate = str(config.conf["braille"]["autoScrollRate"])
speech.speakMessage(rate)
Copy link
Member

Choose a reason for hiding this comment

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

What about braille-only users?

if config.conf["braille"]["autoScrollRate"] > minRate:
config.conf["braille"]["autoScrollRate"] -= 1
rate = str(config.conf["braille"]["autoScrollRate"])
speech.speakMessage(rate)
Copy link
Member

Choose a reason for hiding this comment

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

What about braille-only users?

@nvdaes
Copy link
Collaborator Author

nvdaes commented Nov 25, 2025

Thanks for your review, @SaschaCowley . About only braille users, when a message is shown in braille, scrolling is disabled, but I'll try to fix this.

@nvdaes
Copy link
Collaborator Author

nvdaes commented Nov 25, 2025

@SaschaCowley , I think that I've addressed all your comments, and I've tested this locally.

Copy link
Member

@seanbudd seanbudd left a comment

Choose a reason for hiding this comment

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

@nvdaes - nice work here, I'm sure this will be a much appreciated feature.

:param enable: ``True`` if automatic scroll should be enabled, ``False`` otherwise.
"""

if not self.enabled or config.conf["braille"]["mode"] == BrailleMode.SPEECH_OUTPUT.value:
Copy link
Member

Choose a reason for hiding this comment

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

I'm a bit confused by this, wouldn't braille mode speech output be a major use case for this? i.e. being able to read the braille and hear the speech at roughly the same time?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, may be. I don't use the speech mode, so I didn't think about this. I'll test and add it.

# Timeout after the message will disappear from braille display
messageTimeout = integer(default=4, min=1, max=20)
# Rate for automatic scroll
autoScrollRate = integer(default=10, min=1, max=20)
Copy link
Member

Choose a reason for hiding this comment

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

is 20 different rates too limiting? perhaps the interval step should be 0.1 or 0.5?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, 20 seems too much. Let's use 15 cells/sec. Should we use a slider instead of a spin control?

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking 20 is not enough? I think a spin control is good here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Generally I read at 12 cells/sec or so. According to a rule used in Spain for captions, the recommended speed is 12 chars/sec or so too. I think that 20 is a lot, but may be that in some texts can be used.
We can use 30 if you want. When lines are short, I use the keystroke in the braille display to scroll forward manually.

Copy link
Member

Choose a reason for hiding this comment

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

My concern wasn't about raising it to 30, but instead allowing 10.5/sec or 10.1/sec. e.g. finer grain

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK, then 20 may be enough, but I need to investigate how to allow 0.1 interval using seconds. Perhaps milliseconds wikk be better, or using a slider. I don't know another samples of float numbers with spin controls.

Copy link
Member

Choose a reason for hiding this comment

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

You can use SetIncrement on a wx.SpintCtrl

Copy link
Member

Choose a reason for hiding this comment

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

I think an interval of 0.5 might be enough? We can always change it 0.1 later

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK. I'll try to use SetIncrement and a float value in the config. I'll work for this this weekend.

@CyrilleB79
Copy link
Contributor

FYI, in #12049, I have finally had to use integers in milliseconds rather than float number due to GUI issues (with wx).

@nvdaes
Copy link
Collaborator Author

nvdaes commented Dec 6, 2025

Cyrille wrote:

I have finally had to use integers in milliseconds

I'm investigating several solutions, like using percentages or milliseconds, but I'm not satisfied with the user experience.
I've tried to investigate floatspin, but seems that it's not easy to select the text of the text control.
But in fact, incrementing one cell/sec may provide enough granularity. We are talking about cells/sec, not secs/cells. And anyway the timeout with the same increment in cells/sec will be increased in a different number of milliseconds, depending on the display sice. But I think that cells/sec is better that secs or ms, to get a timeout proportional to the display size.
I'll fix things if I find any errors, and I'll wait for your answer befor moving forward.

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

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Braille text autoscroll

6 participants