Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NVDA can't make system cursor and review cursor follow by using say all in WX's rich text box, Take NVDA log viewer and bookworm as examples #13420

Closed
cary-rowen opened this issue Mar 3, 2022 · 18 comments · Fixed by #13971
Milestone

Comments

@cary-rowen
Copy link
Contributor

cary-rowen commented Mar 3, 2022

Steps to reproduce:

This issue comes from this discussion.

  1. Download Bookworm2022.1a5 portable and open a document at will, or Or open the NVDA log viewer;
  2. Press NVDA+Down Arrow in the text of document;
  3. Press the Numpad Plus in the text of document;
  4. Press twice NVDA+shift+numpad minus;

Actual behavior:

Perform step 2, the system cursor does not change;
Perform step 3, the review cursor does not change;
Perform step 4, Unable to set the system cursor to the position of the review cursor.

Expected behavior:

Perform step 2 and the system cursor should follow the movement
Perform step 3 and the review cursor should follow the movement
Perform step 4 the system cursor can be set to the position of the review cursor

System configuration

NVDA installed/portable/running from source:

installed

NVDA version:

2021.3.3

Windows version:

Windows 10 21H2 (x64) build 19044.1526

Name and version of other software in use when reproducing the issue:

Bookworm2022.1 A5 and NVDA log viewer

Other information about your system:

None

Other questions

Does the issue still occur after restarting your computer?

yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

The latest alpha version of NVDA can also reproduce

If NVDA add-ons are disabled, is your problem still occurring?

Yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

Yes

@cary-rowen cary-rowen changed the title Using NVDA's say all in Bookworm fails to make system cursor and review cursor follow Using NVDA's say all in Bookworm and nvda LogViewer fails to make system cursor and review cursor follow Mar 3, 2022
@cary-rowen
Copy link
Contributor Author

Hi @seanbudd @LeonarddeR
I reproduced the same issue on NVDA's log viewer, so I changed the title.
Can you look into it?
Thanks

@cary-rowen cary-rowen changed the title Using NVDA's say all in Bookworm and nvda LogViewer fails to make system cursor and review cursor follow NVDA can't make system cursor and review cursor follow by using say all in WX's rich text box, Take NVDA log viewer and bookworm as examples Mar 9, 2022
@cary-rowen
Copy link
Contributor Author

cc @michaelDCurran @LeonarddeR @seanbudd

I changed the description and title to be clearer, this is a bug in NVDA can you take a look? This will affect all applications that use WX rich text boxes.

Thanks

@cary-rowen
Copy link
Contributor Author

Hi,
Has NV Access noticed this problem?

@LeonarddeR
Copy link
Collaborator

I looked into this briefly, but all seems right for Wordpad which should be using the same control. Therefore I'm afraid that we can't do much about this.

@cary-rowen
Copy link
Contributor Author

Thanks for noticing this, Does WordPad also use WXPython controls?
The samples I used to reproduce this issue all use the WXPython control. Is it related to WXPython?

@zstanecic
Copy link
Contributor

zstanecic commented Apr 9, 2022 via email

@LeonarddeR
Copy link
Collaborator

I just enforced UIA in these controls and there, it seems to work. Therefore it could be that NVDA is missing something essential here.

@LeonarddeR
Copy link
Collaborator

I think the underlying issue might be that NVDA is using ITextDocument under the hood while UIA does not. When I disable the use of ITextDocumentTextInfo in NVDA, the caret follows nicely.

@cary-rowen
Copy link
Contributor Author

Hi, @LeonarddeR

Thanks again for the more detailed information!
I'm new to NVDA development, this seems to be a UIA bug, in your opinion, can it be fixed in NVDA using another method?

Thanks

@cary-rowen
Copy link
Contributor Author

Hi @zstanecic

As far as this issue is concerned, bookworm may not be able to do anything.

Thanks

@cary-rowen
Copy link
Contributor Author

Hi, @michaelDCurran @LeonarddeR
What is the possible progress for this issue?

@cary-rowen
Copy link
Contributor Author

Hi, @seanbudd
Based on @LeonarddeR's message, do you have any ideas for addressing this in NVDA?

@lukaszgo1
Copy link
Contributor

I believe I now understand why the say all part fails. When in say all NVDA moves by the textInfos.UNIT_READINGCHUNK unit which in most text info implementations defaults to line. In ITextDocumentTextInfo however it defaults to sentence. While this choice seems logical at first glance this heavily depends on the kind and language of text which is being read.
Note the description of this unit from its documentation:

The tomSentence constant describes a string of text that ends with a period, question mark, or exclamation mark and is followed either by one or more ASCII white space characters (9 through 0xd and 0x20), or the Unicode paragraph separator (0x2029). The trailing white space is part of the sentence. The last sentence in a story does not need to have a period, question mark, or exclamation mark. The start of a story qualifies as the start of a tomSentence, even if the string there does not qualify as a sentence grammatically. Other sentences must follow a sentence end and cannot begin with a period, question mark, or exclamation mark.

For us this means that:

  • In a non literary text such as log viewer where the text cannot be divided into sentences in any reasonable way say all fails to move the caret or review cursor since most of the text appears as a singe sentence
  • In bookworm how well say all works depends on what kind of text is being read and in what language it was written - I believe @cary-rowen is from China and in Chinese the definition of sentence from above does not apply.

In my opinion a quick fix here would be to set UNIT_READINGCHUNK for ITextDocumentTextInfo back to line so that the experience is not worse than in most edit controls. In the long run it might be beneficial to try to resurrect #11658 so that say all moves by word.

I can submit a PR to that effect if @seanbudd agrees, but I also would like to clarify this comment by @LeonarddeR

all seems right for Wordpad which should be using the same control. Therefore I'm afraid that we can't do much about this.

For me in WordPad the experience also depends on the kind of text which is being read - for novels everything works fine, but when pasting content of the NVDA log and trying to read it continuously caret also fails to move. Can you confirm this?

@LeonarddeR
Copy link
Collaborator

When I paste the log viewer contents to Wordpad, it also fails indeed. Wow, great catch @lukaszgo1. I think your suggestion is definitely the right approach.

@seanbudd
Copy link
Member

seanbudd commented Aug 1, 2022

I would suggest a PR stacked against #13956, targeting branch: revert-13954-revert-table-sayall.

When the fix is tested and approved, both can get merged to master

@lukaszgo1
Copy link
Contributor

I would suggest a PR stacked against #13956, targeting branch: revert-13954-revert-table-sayall.

When the fix is tested and approved, both can get merged to master

I've opened #13971 however it targets master, since even with this fix say all fails to turn pages in bookworm with #13956 applied.

@lukaszgo1
Copy link
Contributor

@cary-rowen Please test this build.

seanbudd pushed a commit that referenced this issue Aug 2, 2022
…13971)

Fixes #13420
Fixes #9179

Summary of the issue:
When in say all NVDA moves caret by the unit specified as a RREADINGCHUNK for a given text info implementation. In most text info implementations it defaults to line, however in ITextDocumentTextInfo it was set to sentence. While it probably results in smoother reading for literary text written in language where TOM can split into sentences properly, in text's such as log or for languages without clear concept of sentence such as Chinese it results in caret not following spoken text since it is moved to the current position only when the sentence ending is reached.

Description of user facing changes
Say all both for review and system cursor moves by line in Rich Edit controls such as WordPad or NVDA's log viewer.

Description of development approach
for ITextDocumentTextInfo textInfos.UNIT_READINGCHUNK has been set to line.
@nvaccessAuto nvaccessAuto added this to the 2022.4 milestone Aug 2, 2022
@cary-rowen
Copy link
Contributor Author

Thanks @lukaszgo1 for the effort, just for the Say All #13971 is perfect, according to the description of this issue, if #13968 is fixed, then this issue can be closed completely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants