[Nvda-dev] commit r3409 - in trunk: source/NVDAObjects source/NVDAObjects/IAccessible source/NVDAObjects/JAB source/NVDAObjects/UIA source/NVDAObjects/window user_docs/en

NVDA Subversion svn at nvda-project.org
Fri Dec 4 08:35:05 UTC 2009


Author: bzr
Date: Fri Dec  4 08:35:05 2009
New Revision: 3409

Log:
      The word being deleted is now announced when pressing control+backspace in controls that support it. Specifically: the logic from script_backspace is now in a method called _backspaceScriptHelper, which takes both a keyPress, and a unit.  Script_backspace no longer exists, however script_backspaceCharacter and script_backspaceWord are now used. Fixes #491

Modified:
   trunk/source/NVDAObjects/IAccessible/MSHTML.py
   trunk/source/NVDAObjects/IAccessible/__init__.py
   trunk/source/NVDAObjects/JAB/__init__.py
   trunk/source/NVDAObjects/UIA/__init__.py
   trunk/source/NVDAObjects/__init__.py
   trunk/source/NVDAObjects/window/edit.py
   trunk/source/NVDAObjects/window/scintilla.py
   trunk/source/NVDAObjects/window/winConsole.py
   trunk/source/NVDAObjects/window/winword.py
   trunk/user_docs/en/whats new.txt

Modified: trunk/source/NVDAObjects/IAccessible/MSHTML.py
==============================================================================
--- trunk/source/NVDAObjects/IAccessible/MSHTML.py	(original)
+++ trunk/source/NVDAObjects/IAccessible/MSHTML.py	Fri Dec  4 08:35:05 2009
@@ -310,7 +310,8 @@
 				("control+shift+extendedHome","changeSelection"),
 				("control+shift+extendedEnd","changeSelection"),
 				("ExtendedDelete","moveByCharacter"),
-				("Back","backspace"),
+				("Back","backspaceCharacter"),
+				("Control+Back","backspaceWord"),
 			]]
 
 	def isDuplicateIAccessibleEvent(self,obj):

Modified: trunk/source/NVDAObjects/IAccessible/__init__.py
==============================================================================
--- trunk/source/NVDAObjects/IAccessible/__init__.py	(original)
+++ trunk/source/NVDAObjects/IAccessible/__init__.py	Fri Dec  4 08:35:05 2009
@@ -456,7 +456,8 @@
 					("control+extendedHome","moveByLine"),
 					("control+extendedEnd","moveByLine"),
 					("ExtendedDelete","delete"),
-					("Back","backspace"),
+					("Back","backspaceCharacter"),
+					("Control+Back","backspaceWord"),
 				]]
 		except:
 			pass

Modified: trunk/source/NVDAObjects/JAB/__init__.py
==============================================================================
--- trunk/source/NVDAObjects/JAB/__init__.py	(original)
+++ trunk/source/NVDAObjects/JAB/__init__.py	Fri Dec  4 08:35:05 2009
@@ -208,7 +208,8 @@
 					("control+shift+extendedHome","changeSelection"),
 					("control+shift+extendedEnd","changeSelection"),
 					("ExtendedDelete","delete"),
-					("Back","backspace"),
+					("Back","backspaceCharacter"),
+					("Control+Back","backspaceWord"),
 			  	]]
 
 	def _get_TextInfo(self):

Modified: trunk/source/NVDAObjects/UIA/__init__.py
==============================================================================
--- trunk/source/NVDAObjects/UIA/__init__.py	(original)
+++ trunk/source/NVDAObjects/UIA/__init__.py	Fri Dec  4 08:35:05 2009
@@ -208,7 +208,8 @@
 				("control+extendedHome","moveByLine"),
 				("control+extendedEnd","moveByLine"),
 				("ExtendedDelete","delete"),
-				("Back","backspace"),
+				("Back","backspaceCharacter"),
+				("Control+Back","backspaceWord"),
 			]]
 
 	def _isEqual(self,other):

Modified: trunk/source/NVDAObjects/__init__.py
==============================================================================
--- trunk/source/NVDAObjects/__init__.py	(original)
+++ trunk/source/NVDAObjects/__init__.py	Fri Dec  4 08:35:05 2009
@@ -736,7 +736,7 @@
 			info.expand(textInfos.UNIT_PARAGRAPH)
 			speech.speakTextInfo(info)
 
-	def script_backspace(self,keyPress):
+	def _backspaceScriptHelper(self,unit,keyPress):
 		try:
 			oldInfo=self.makeTextInfo(textInfos.POSITION_CARET)
 		except:
@@ -746,13 +746,16 @@
 		testInfo=oldInfo.copy()
 		res=testInfo.move(textInfos.UNIT_CHARACTER,-1)
 		if res<0:
-			testInfo.expand(textInfos.UNIT_CHARACTER)
-			delChar=testInfo.text
+			testInfo.expand(unit)
+			delChunk=testInfo.text
 		else:
-			delChar=""
+			delChunk=""
 		sendKey(keyPress)
 		if self._hasCaretMoved(oldBookmark):
-			speech.speakSpelling(delChar)
+			if len(delChunk)>1:
+				speech.speakMessage(delChunk)
+			else:
+				speech.speakSpelling(delChunk)
 			focus=api.getFocusObject()
 			try:
 				info=focus.makeTextInfo(textInfos.POSITION_CARET)
@@ -761,6 +764,12 @@
 			if globalVars.caretMovesReviewCursor:
 				api.setReviewPosition(info)
 
+	def script_backspaceCharacter(self,keyPress):
+		self._backspaceScriptHelper(textInfos.UNIT_CHARACTER,keyPress)
+
+	def script_backspaceWord(self,keyPress):
+		self._backspaceScriptHelper(textInfos.UNIT_WORD,keyPress)
+
 	def script_delete(self,keyPress):
 		try:
 			info=self.makeTextInfo(textInfos.POSITION_CARET)

Modified: trunk/source/NVDAObjects/window/edit.py
==============================================================================
--- trunk/source/NVDAObjects/window/edit.py	(original)
+++ trunk/source/NVDAObjects/window/edit.py	Fri Dec  4 08:35:05 2009
@@ -762,7 +762,8 @@
 	("control+extendedHome","moveByLine"),
 	("control+extendedEnd","moveByLine"),
 	("ExtendedDelete","delete"),
-	("Back","backspace"),
+	("Back","backspaceCharacter"),
+	("Control+Back","backspaceWord"),
 ]]
 
 class RichEdit(Edit):

Modified: trunk/source/NVDAObjects/window/scintilla.py
==============================================================================
--- trunk/source/NVDAObjects/window/scintilla.py	(original)
+++ trunk/source/NVDAObjects/window/scintilla.py	Fri Dec  4 08:35:05 2009
@@ -230,5 +230,6 @@
 	("control+shift+extendedHome","changeSelection"),
 	("control+shift+extendedEnd","changeSelection"),
 	("ExtendedDelete","delete"),
-	("Back","backspace"),
+	("Back","backspaceCharacter"),
+	("Control+Back","backspaceWord"),
 ]]

Modified: trunk/source/NVDAObjects/window/winConsole.py
==============================================================================
--- trunk/source/NVDAObjects/window/winConsole.py	(original)
+++ trunk/source/NVDAObjects/window/winConsole.py	Fri Dec  4 08:35:05 2009
@@ -52,5 +52,5 @@
 	("control+shift+extendedHome","changeSelection"),
 	("control+shift+extendedEnd","changeSelection"),
 	("ExtendedDelete","delete"),
-	("Back","backspace"),
+	("Back","backspaceCharacter"),
 ]]

Modified: trunk/source/NVDAObjects/window/winword.py
==============================================================================
--- trunk/source/NVDAObjects/window/winword.py	(original)
+++ trunk/source/NVDAObjects/window/winword.py	Fri Dec  4 08:35:05 2009
@@ -405,7 +405,8 @@
 	("control+shift+extendedHome","changeSelection"),
 	("control+shift+extendedEnd","changeSelection"),
 	("ExtendedDelete","delete"),
-	("Back","backspace"),
+	("Back","backspaceCharacter"),
+	("Control+Back","backspaceWord"),
 	("control+alt+extendedUp","previousRow"),
 	("control+alt+extendedDown","nextRow"),
 	("control+alt+extendedLeft","previousColumn"),

Modified: trunk/user_docs/en/whats new.txt
==============================================================================
--- trunk/user_docs/en/whats new.txt	(original)
+++ trunk/user_docs/en/whats new.txt	Fri Dec  4 08:35:05 2009
@@ -6,6 +6,7 @@
 	* NVDA no longer fails to start on a system with no audio output devices. Obviously, a braille display or the Display synthesiser will need to be used for output in this case. (#425)
 	* A report landmarks checkbox has been added to the Document Formatting settings dialog which allows you to configure whether NVDA should announce landmarks in web documents. For compatibility with the previous release, the option is on by default.
 	* If speak command keys is enabled, NVDA will now announce the names of multimedia keys (e.g. play, stop, home page, etc.) when they are pressed. (#472)
+	* NVDA now announces the word being deleted when pressing control+backspace in controls that support it.
 
 === Changes ===
 



More information about the Nvda-dev mailing list