Skip to content

Commit

Permalink
Merge branch 't3288'. Fixes #3288
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelDCurran committed Mar 16, 2015
2 parents 3d61d89 + 96c2c20 commit 36d6d96
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
10 changes: 10 additions & 0 deletions source/cursorManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ def script_moveByLine_forward(self,gesture):
self._caretMovementScriptHelper(gesture,textInfos.UNIT_LINE,1)
script_moveByLine_forward.resumeSayAllMode=sayAllHandler.CURSOR_CARET

def script_moveBySentence_back(self,gesture):
self._caretMovementScriptHelper(gesture,textInfos.UNIT_SENTENCE,-1)
script_moveBySentence_back.resumeSayAllMode=sayAllHandler.CURSOR_CARET

def script_moveBySentence_forward(self,gesture):
self._caretMovementScriptHelper(gesture,textInfos.UNIT_SENTENCE,1)
script_moveBySentence_forward.resumeSayAllMode=sayAllHandler.CURSOR_CARET

def script_moveByParagraph_back(self,gesture):
self._caretMovementScriptHelper(gesture,textInfos.UNIT_PARAGRAPH,-1)
script_moveByParagraph_back.resumeSayAllMode=sayAllHandler.CURSOR_CARET
Expand Down Expand Up @@ -335,6 +343,8 @@ def script_copyToClipboard(self,gesture):
"kb:NVDA+Control+f": "find",
"kb:NVDA+f3": "findNext",
"kb:NVDA+shift+f3": "findPrevious",
"kb:alt+upArrow":"moveBySentence_back",
"kb:alt+downArrow":"moveBySentence_forward",
}

class _ReviewCursorManagerTextInfo(textInfos.TextInfo):
Expand Down
21 changes: 21 additions & 0 deletions source/editableText.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,18 @@ def script_caret_newLine(self,gesture):
onlyInitial=False
speech.speakTextInfo(lineInfo,unit=textInfos.UNIT_LINE,reason=controlTypes.REASON_CARET,onlyInitialFields=onlyInitial,suppressBlanks=True)

def _caretMoveBySentenceHelper(self, gesture, direction):
if isScriptWaiting():
return
try:
info=self.makeTextInfo(textInfos.POSITION_CARET)
info.move(textInfos.UNIT_SENTENCE, direction)
info.updateCaret()
self._caretScriptPostMovedHelper(textInfos.UNIT_SENTENCE,gesture,info)
except:
gesture.send()
return

def script_caret_moveByLine(self,gesture):
self._caretMovementScriptHelper(gesture, textInfos.UNIT_LINE)
script_caret_moveByLine.resumeSayAllMode=sayAllHandler.CURSOR_CARET
Expand All @@ -141,6 +153,13 @@ def script_caret_moveByParagraph(self,gesture):
self._caretMovementScriptHelper(gesture, textInfos.UNIT_PARAGRAPH)
script_caret_moveByParagraph.resumeSayAllMode=sayAllHandler.CURSOR_CARET

def script_caret_previousSentence(self,gesture):
self._caretMoveBySentenceHelper(gesture, -1)
script_caret_previousSentence.resumeSayAllMode=sayAllHandler.CURSOR_CARET

def script_caret_nextSentence(self,gesture):
self._caretMoveBySentenceHelper(gesture, 1)
script_caret_nextSentence.resumeSayAllMode=sayAllHandler.CURSOR_CARET

def _backspaceScriptHelper(self,unit,gesture):
try:
Expand Down Expand Up @@ -196,6 +215,8 @@ def script_caret_delete(self,gesture):
"kb:control+rightArrow": "caret_moveByWord",
"kb:control+upArrow": "caret_moveByParagraph",
"kb:control+downArrow": "caret_moveByParagraph",
"kb:alt+upArrow": "caret_previousSentence",
"kb:alt+downArrow": "caret_nextSentence",
"kb:home": "caret_moveByCharacter",
"kb:end": "caret_moveByCharacter",
"kb:control+home": "caret_moveByLine",
Expand Down
3 changes: 3 additions & 0 deletions user_docs/en/changes.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

= 2015.2 =

== New Features ==
- moving forward and backward by sentence in Microsoft Word is now possible with alt+downArrow and alt+upArrow respectively. (#3288)


= 2015.1 =
Highlights of this release include browse mode for documents in Microsoft Word and Outlook; major enhancements to support for Skype for Desktop; and significant fixes for Microsoft Internet Explorer.
Expand Down
2 changes: 2 additions & 0 deletions user_docs/en/userGuide.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ NVDA provides the following key commands in relation to the system caret:
| Say all | NVDA+downArrow | NVDA+a | Starts reading from the current position of the system caret, moving it along as it goes |
| Read current line | NVDA+upArrow | NVDA+l | Reads the line where the system caret is currently situated. Pressing twice spells the line. |
| Read current text selection | NVDA+Shift+upArrow | NVDA+shift+s | Reads any currently selected text |
| nextSentence | alt+downArrow | alt+downArrow | Moves the caret to the next sentence and announces it. (only supported in Microsoft Word) |
| previousSentence | alt+upArrow | alt+upArrow | Moves the caret to the previous sentence and announces it. (only supported in Microsoft Word) |


When within a table, the following key commands are also available:
Expand Down

0 comments on commit 36d6d96

Please sign in to comment.