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

Enable cursor movement with braille display routing keys in PowerPoint #17004

Merged
merged 8 commits into from
Aug 15, 2024
8 changes: 8 additions & 0 deletions source/appModules/powerpnt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,14 @@ def _getFormatFieldAndOffsets(self, offset, formatConfig, calculateOffsets=True)
formatField["link"] = True
return formatField, (startOffset, endOffset)

def _setCaretOffset(self, offset: int):
seanbudd marked this conversation as resolved.
Show resolved Hide resolved
if not 0 <= offset <= (maxLength := self._getStoryLength()):
SaschaCowley marked this conversation as resolved.
Show resolved Hide resolved
log.debugWarning(f"Got out of range {offset=} (min 0, max {maxLength}. Clamping.", stack_inf=True)
offset = max(0, min(offset, maxLength))
# Use the TextRange.select method to move the text caret to a 0-length TextRange.
# The TextRange.characters method is 1-indexed.
self.obj.ppObject.textRange.characters(offset + 1, 0).select()


class Table(Shape):
"""Represents the table shape in Powerpoint. Provides row and column counts."""
Expand Down
1 change: 1 addition & 0 deletions user_docs/en/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The available options are:
* The timeout to perform a multiple keypress is now configurable; this may be especially useful for people with dexterity impairment. (#11929, @CyrilleB79)
* When performing a braille cursor routing action, NVDA can now automatically speak the character at the cursor. (#8072, @LeonarddeR)
* This option is disabled by default. You can enable "Speak character when routing cursor in text" in NVDA's braille settings.
* It is now possible to use braille display routing keys to move the text cursor in Microsoft PowerPoint. (#9101)

### Changes

Expand Down