Changeset 2393

Show
Ignore:
Timestamp:
09/25/08 09:51:31 (3 months ago)
Author:
mdcurran
Message:

speech.speakSelectionChanges: If the selection expands from collapsed, just speak the entire selection as one chunk. Same when the selection goes from expanded to collapsed, just speak the unselection as one chunk. Previously if the selection expanded out both ways at the same time, NVDA would announce two selections, one after each other. Same with unselecting, to a mid point, NVDA would announce two unselections. A good example of this is an edit field with a few words and where the caret is on the middle word and then you do ctrl+a to select all, NVDA would have previously annopunced two chunks, now it just announces one.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/source/speech.py

    r2377 r2393  
    287287        endToStart=newInfo.compareEndPoints(oldInfo,"endToStart") 
    288288        endToEnd=newInfo.compareEndPoints(oldInfo,"endToEnd") 
    289         if startToEnd>0 or endToStart<0: 
    290                 if speakSelected and not newInfo.isCollapsed: 
    291                         selectedTextList.append(newInfo.text) 
    292                 if speakUnselected and not oldInfo.isCollapsed: 
    293                         unselectedTextList.append(oldInfo.text) 
    294         else: 
    295                 if speakSelected and startToStart<0 and not newInfo.isCollapsed: 
    296                         tempInfo=newInfo.copy() 
    297                         tempInfo.setEndPoint(oldInfo,"endToStart") 
    298                         selectedTextList.append(tempInfo.text) 
    299                 if speakSelected and endToEnd>0 and not newInfo.isCollapsed: 
    300                         tempInfo=newInfo.copy() 
    301                         tempInfo.setEndPoint(oldInfo,"startToEnd") 
    302                         selectedTextList.append(tempInfo.text) 
    303                 if startToStart>0 and not oldInfo.isCollapsed: 
    304                         tempInfo=oldInfo.copy() 
    305                         tempInfo.setEndPoint(newInfo,"endToStart") 
    306                         unselectedTextList.append(tempInfo.text) 
    307                 if endToEnd<0 and not oldInfo.isCollapsed: 
    308                         tempInfo=oldInfo.copy() 
    309                         tempInfo.setEndPoint(newInfo,"startToEnd") 
    310                         unselectedTextList.append(tempInfo.text) 
     289        if speakSelected and oldInfo.isCollapsed: 
     290                selectedTextList.append(newInfo.text) 
     291        elif speakUnselected and newInfo.isCollapsed: 
     292                unselectedTextList.append(oldInfo.text) 
     293        else: 
     294                if startToEnd>0 or endToStart<0: 
     295                        if speakSelected and not newInfo.isCollapsed: 
     296                                selectedTextList.append(newInfo.text) 
     297                        if speakUnselected and not oldInfo.isCollapsed: 
     298                                unselectedTextList.append(oldInfo.text) 
     299                else: 
     300                        if speakSelected and startToStart<0 and not newInfo.isCollapsed: 
     301                                tempInfo=newInfo.copy() 
     302                                tempInfo.setEndPoint(oldInfo,"endToStart") 
     303                                selectedTextList.append(tempInfo.text) 
     304                        if speakSelected and endToEnd>0 and not newInfo.isCollapsed: 
     305                                tempInfo=newInfo.copy() 
     306                                tempInfo.setEndPoint(oldInfo,"startToEnd") 
     307                                selectedTextList.append(tempInfo.text) 
     308                        if startToStart>0 and not oldInfo.isCollapsed: 
     309                                tempInfo=oldInfo.copy() 
     310                                tempInfo.setEndPoint(newInfo,"endToStart") 
     311                                unselectedTextList.append(tempInfo.text) 
     312                        if endToEnd<0 and not oldInfo.isCollapsed: 
     313                                tempInfo=oldInfo.copy() 
     314                                tempInfo.setEndPoint(newInfo,"startToEnd") 
     315                                unselectedTextList.append(tempInfo.text) 
    311316        if speakSelected: 
    312317                if not generalize: