-
-
Notifications
You must be signed in to change notification settings - Fork 650
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
Speak typed words based on TextInfo if possible #8110
Conversation
How would this work with Chinese and Japanese or with languages that do not have spaces? |
Good point, that ought to be tested as I don't speak these languages. @josephsl, would you be able to testdrive this for Korean?
|
I cloned the code and tried. |
Could you provide a test build for Korean users? |
@dnz3d4c commented on 26 mrt. 2018 02:50 CEST:
Sure. Here is a try build. |
Thanks @LeonarddeR |
It is likely that this may regress #456. Although it was not totally clear from the reporter, moving to uniscribe for virtualBuffers fixed Thai word segmentation issues. |
In what real-world cases will this code fall back to the old character buffer implementation? |
@michaelDCurran commented on 15 Apr 2018, 23:57 CEST:
That would have no impact at all.
The latter. I think we should just keep using uniscribe for now. |
@michaelDCurran commented on 16 Apr 2018, 00:22 CEST:
I could think of several of these cases, I tried to document them in the code.
|
Re Firefox updating fast enough, I wonder if we can delay our code a
bit. Either re-queue it one more time, or perhaps even do something
similar to hasCaretMoved, but perhaps for only 50ms or so.
For auto indenting, we could specifically handle this in some kind of
script for kb:enter perhaps? Then we'd no to check the line above if the
current line started with whitespace.
Just some out of the box ideas.
|
@michaelDCurran commented on 16 apr. 2018 23:39 CEST:
I'm not 100% sure whether it is because Firefox lags behind. It really feels like it, though. However, using a short delay might make this somewhat more clear.
Interesting idea, I'm going to try this. |
@michaelDCurran commented on 16 apr. 2018 23:39 CEST:
This is now covered. I reverted the firefox hack while at it, since it didn't play nice with reporting the typed character before sending enter to the system. I will have to look into the firefox issue again. |
@michaelDCurran commented on 16 apr. 2018 23:39 CEST:
Queuing one additional time doesn't seem to be enough, so there are now three attempts with 5 ms inbetween. |
Currently a unit test fails: FAIL: test_onlySpaces (tests.unit.test_textInfos.TestFindWordBeforeCaret_exceptions) |
Ah, I missed that, but really need to do some additional local testing
anyway. This feature is really hard to get right. I'll look into it
again today, thanks a lot for doing an additional review.
|
The more and more I test, the more I'm tempted to disable this for IA2Web objects altogether. I'm experiencing several issues, including the following:
IN quite a few occurrences, when pressing space after typing a word, NVDA announces the number sign that starts the new line as part of the typed word. |
This reverts commit 22d148ba086ea8b9122049697c5cf178cf82a76b.
I realised that a disadvantage of the new approach is that it is more difficult to test, as it now relies on actual caret movement to cache the position before the caret moves. Having said that, the current approach is much less error prone. I will have to look into this. |
The current implementation is a bit sluggish in UIA consoles, probably because of the _caretMovementTimeoutMultiplier. |
PR introduces Flake8 errors 😲 See test results for Failed build of commit 365e8a1202 |
hi @LeonarddeR |
I wrote this pull request on behalf of @BabbageCom. As I'm leaving @BabbageCom after the 29th of November, I can no longer afford maintaining this pr other than applying very basic review actions. If this pull request requires major changes, they will have to be applied by someone else, e.g. @sjfbol or whoever else is willing to take it.
Nope. |
Although there are definite advantages of this approach, there are several limitations and bugs noted in the pr description. Also @LeonarddeR has suggested he will have no time to work on it in future. Therefore we are closing this. However, if anyone wants to pick up this work they are welcome. At very least learning from how some of this code was done. |
Labeled this as abandoned so someone can find it easier by filtering the label. |
cc: @mltony, @cary-rowen this might be interesting in light of word navigation and word pronouncing, maybe #16219 have opened up some new possibilities. |
Link to issue number:
Closes #8065
Fixes #7812
Fixes #6215
Summary of the issue:
When speaking typed words, NVDA always relies on a buffer to speak the typed word. This causes the following problems.
Description of how this pull request fixes the issue:
NVDA now tries to
use the TextInfo information to announce the last entered word. This works as follows:
speech.speakTypedCharacters no longer speaks typed words, but devotes this to a new function, speech.speakPreviousWord that takes the word separator as an argument.
speech.speakPreviousWord creates a TextInfo for the caret and calls textInfo.findWordBeforeCaret. This new function manipulates the textInfo and:
speech.speakPreviousWord also deals with reporting of spelling errors as you type.
NVDAObject._reportErrorInPreviousWord has been removed, logic from this function has been spread out over the two functions explained above.
This disables uniscribe based word offset calculations by default and enables uniscribe specifically for edit text controls. This is because the idea of uniscribe about what characters separate words is totally different from what most other applications do (i.e. dot, comma are not considered word separators). Note that this will result in slightly different moving by word behaviour in virtual buffers.
Open to discussion
Testing performed:
Tested several applications, including:
Known issues with pull request:
Change log entry:
Changes
Bug fixes