Vocalize paragraph indent and hanging indent shortcuts in MS Word#10415
Conversation
|
Additional comment: |
|
Is there anything blocking this PR from being looked at? cc @seanbudd since you've recently started reviewing some older PR's. |
seanbudd
left a comment
There was a problem hiding this comment.
Thanks @CyrilleB79, looks good to me and I have confirmed it works as intended with MS Word
There was a problem hiding this comment.
@CyrilleB79 - I noticed that in #6269 it was mentioned that other languages use different keyboard commands. I wanted to just add that this will cause this gesture to announce the current indentation once the timeout is reached, regardless if it is an indentation related action. Perhaps it would be better to announce only if the indentation is changed
| margin = self.WinwordDocumentObject.PageSetup.LeftMargin | ||
| val = self._WaitForValueChangeForAction( | ||
| lambda: gesture.send(), | ||
| lambda: self.WinwordSelectionObject.paragraphFormat.LeftIndent | ||
| ) | ||
| msg = self.getLocalizedMeasurementTextForPointSize(margin + val) |
There was a problem hiding this comment.
| margin = self.WinwordDocumentObject.PageSetup.LeftMargin | |
| val = self._WaitForValueChangeForAction( | |
| lambda: gesture.send(), | |
| lambda: self.WinwordSelectionObject.paragraphFormat.LeftIndent | |
| ) | |
| msg = self.getLocalizedMeasurementTextForPointSize(margin + val) | |
| margin = self.WinwordDocumentObject.PageSetup.LeftMargin | |
| oldVal = self.WinwordSelectionObject.paragraphFormat.LeftIndent | |
| val = self._WaitForValueChangeForAction( | |
| lambda: gesture.send(), | |
| lambda: self.WinwordSelectionObject.paragraphFormat.LeftIndent | |
| ) | |
| if oldVal == val: | |
| # indentation hasn't changed, it's likely the gesture used is not mapped to an | |
| # indentation change in Word, which is the case for some languages (see #6269). | |
| return | |
| msg = self.getLocalizedMeasurementTextForPointSize(margin + val) |
There was a problem hiding this comment.
Localizing the keystrokes is the work of translators (edition of the gestures.ini file).
I am a bit reluctant to add this piece of code that is useful only in case a translator has not done the required translation.
Note also that this strategy is not the one used for other formatting commands. For example, not all languages use control+B to toggle bold formatting, e.g. French and Italien use ctrl+G (for "Gras" / "Grassetto").
Link to issue number:
Fixes #6269
Summary of the issue:
In MS Word, the result of indent and hanging indent shortcuts is not announced by NVDA. It may be useful for the user to know the distance from the left edge of the page, as done when pressing Tab or Shift+Tab.
Description of how this pull request fixes the issue:
When the following shortcuts are executed, the distance from the left edge of the page of the paragraph is reported:
The reported distance is the one from left edge of page to the beginning of all line of the paragraph except the first that may differ.
The listed shortcuts are the ones of English version of MS Word. They may differ for other languages. In this case, translators will need to update gesture.ini file accordingly.
Testing performed:
Executed all these shortcuts and checked that the distance was correctly announced.
Known issues with pull request:
None
Change log entry:
Section: Changes
In Microsoft Word, NVDA now announces the result of indent and hanging indent shortcuts when executed. (#6269)